| 1 | <?php |
||
| 9 | class TestKernel extends Kernel |
||
| 10 | { |
||
| 11 | private $configFilename; |
||
| 12 | |||
| 13 | public function __construct($env, $debug, $configFilename) |
||
| 14 | { |
||
| 15 | parent::__construct($env, $debug); |
||
| 16 | |||
| 17 | $this->configFilename = $configFilename; |
||
| 18 | |||
| 19 | $this->cacheDir = $cacheDir = tempnam(sys_get_temp_dir(), 'raven-bundle-test'); |
||
|
|
|||
| 20 | unlink($cacheDir); |
||
| 21 | |||
| 22 | register_shutdown_function(function () use ($cacheDir) { |
||
| 23 | $fs = new Filesystem(); |
||
| 24 | $fs->remove($cacheDir); |
||
| 25 | }); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function registerBundles() |
||
| 38 | |||
| 39 | public function getCacheDir() |
||
| 43 | |||
| 44 | public function registerContainerConfiguration(LoaderInterface $loader) |
||
| 48 | } |
||
| 49 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: