If you look at the code its clearly defined and public.
<?php
class Config {
public function prep_connections($collection){
}
public function get_connctions(){
require_once('readfile.php');
$reader = new Readfile();
$collections = json_decode($reader->read("../../config/database.cfg"));
foreach($collections as $collection){
prep_connections($collection);
}
}
}
$config = new Config();
$connections = $config->get_connctions();
You need to call it via
$this, to tell it is in the same/this class