Supported Versions: PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8
Checks if the given key or index exists in the array
Alias key_exists
<?php array_key_exists(string|int|float|bool|resource|null $key, array $array): bool
<?php         $method = preg_replace('~.+::~', '', $method);

        $key = join('@', [$method, $path]);



        if ( ! array_key_exists($key, $this->stagedExceptions)) {

            return;

        }
<?php         $key = $this->prefixer->prefixPath($path);

        $acl = $this->determineAcl($config);

        $options = $this->createOptionsFromConfig($config);

        $shouldDetermineMimetype = '' !== $body && ! \array_key_exists('ContentType', $options);



        if ($shouldDetermineMimetype && $mimeType = $this->mimeTypeDetector->detectMimeType($key, $body)) {

            $options['ContentType'] = $mimeType;
<?php     private function getStagedResult(string $name): ?Result

    {

        if (array_key_exists($name, $this->stagedExceptions)) {

            $exception = $this->stagedExceptions[$name];

            unset($this->stagedExceptions[$name]);
<?php             throw $exception;

        }



        if (array_key_exists($name, $this->stagedResult)) {

            $result = $this->stagedResult[$name];

            unset($this->stagedResult[$name]);
<?php         $key = $this->prefixer->prefixPath($path);

        $options = $this->createOptionsFromConfig($config);

        $acl = $options['ACL'] ?? $this->determineAcl($config);

        $shouldDetermineMimetype = $body !== '' && ! array_key_exists('ContentType', $options);



        if ($shouldDetermineMimetype && $mimeType = $this->mimeTypeDetector->detectMimeType($key, $body)) {

            $options['ContentType'] = $mimeType;
<?php     {

        $name = $command->getName();



        if (array_key_exists($name, $this->stagedExceptions)) {

            $exception = $this->stagedExceptions[$name];

            unset($this->stagedExceptions[$name]);

            throw $exception;
<?php             throw $exception;

        }



        if (array_key_exists($name, $this->stagedResult)) {

            $result = $this->stagedResult[$name];

            unset($this->stagedResult[$name]);
<?php         foreach ($objects->prefixes() as $prefix) {

            $prefix = $this->prefixer->stripDirectoryPrefix($prefix);



            if (array_key_exists($prefix, $prefixes)) {

                continue;

            }
<?php     public function fileExists(string $path): bool

    {

        return array_key_exists($this->preparePath($path), $this->files);

    }



    public function write(string $path, string $contents, Config $config): void
<?php     {

        $path = $this->preparePath($path);



        if (array_key_exists($path, $this->files) === false) {

            throw UnableToReadFile::fromLocation($path, 'file does not exist');

        }
<?php     {

        $path = $this->preparePath($path);



        if (array_key_exists($path, $this->files) === false) {

            throw UnableToReadFile::fromLocation($path, 'file does not exist');

        }
<?php     {

        $path = $this->preparePath($path);



        if (array_key_exists($path, $this->files) === false) {

            throw UnableToSetVisibility::atLocation($path, 'file does not exist');

        }
<?php     {

        $path = $this->preparePath($path);



        if (array_key_exists($path, $this->files) === false) {

            throw UnableToRetrieveMetadata::visibility($path, 'file does not exist');

        }
<?php     {

        $preparedPath = $this->preparePath($path);



        if (array_key_exists($preparedPath, $this->files) === false) {

            throw UnableToRetrieveMetadata::mimeType($path, 'file does not exist');

        }
<?php     {

        $path = $this->preparePath($path);



        if (array_key_exists($path, $this->files) === false) {

            throw UnableToRetrieveMetadata::lastModified($path, 'file does not exist');

        }