Pyrech\ComposerChangelogs\Config\ConfigLocator::locate PHP Метод

locate() публичный Метод

Try to locate where is the config for the given key.
public locate ( string $key ) : boolean
$key string
Результат boolean
    public function locate($key)
    {
        if (array_key_exists($key, $this->cache)) {
            return $this->cache[$key]['found'];
        }
        if ($this->locateLocal($key)) {
            return true;
        }
        if ($this->locateGlobal($key)) {
            return true;
        }
        $this->cache[$key] = ['found' => false, 'config' => [], 'path' => null];
        return false;
    }

Usage Example

 public function test_it_does_not_locate_non_existing_config()
 {
     $key = 'my-non-existing-config';
     static::assertFalse($this->SUT->locate($key));
     static::assertNull($this->SUT->getPath($key));
     static::assertSame([], $this->SUT->getConfig($key));
 }