Full Code of php-fig/container for AI

master 707984727bd5 cached
8 files
3.9 KB
1.1k tokens
5 symbols
1 requests
Download .txt
Repository: php-fig/container
Branch: master
Commit: 707984727bd5
Files: 8
Total size: 3.9 KB

Directory structure:
gitextract_siiew8ni/

├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── composer.json
└── src/
    ├── ContainerExceptionInterface.php
    ├── ContainerInterface.php
    └── NotFoundExceptionInterface.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
.gitattributes  export-ignore
.gitignore      export-ignore


================================================
FILE: .gitignore
================================================
composer.lock
composer.phar
/vendor/


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2013-2016 container-interop
Copyright (c) 2016 PHP Framework Interoperability Group

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
Container interface
==============

This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url].

Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container.

The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.

[psr-url]: https://www.php-fig.org/psr/psr-11/
[package-url]: https://packagist.org/packages/psr/container
[implementation-url]: https://packagist.org/providers/psr/container-implementation



================================================
FILE: composer.json
================================================
{
    "name": "psr/container",
    "type": "library",
    "description": "Common Container Interface (PHP FIG PSR-11)",
    "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"],
    "homepage": "https://github.com/php-fig/container",
    "license": "MIT",
    "authors": [
        {
            "name": "PHP-FIG",
            "homepage": "https://www.php-fig.org/"
        }
    ],
    "support": {
        "source": "https://github.com/php-fig/container"
    },
    "require": {
        "php": ">=7.4.0"
    },
    "autoload": {
        "psr-4": {
            "Psr\\Container\\": "src/"
        }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "2.0.x-dev"
        }
    }
}


================================================
FILE: src/ContainerExceptionInterface.php
================================================
<?php

namespace Psr\Container;

use Throwable;

/**
 * Base interface representing a generic exception in a container.
 */
interface ContainerExceptionInterface extends Throwable
{
}


================================================
FILE: src/ContainerInterface.php
================================================
<?php

declare(strict_types=1);

namespace Psr\Container;

/**
 * Describes the interface of a container that exposes methods to read its entries.
 */
interface ContainerInterface
{
    /**
     * Finds an entry of the container by its identifier and returns it.
     *
     * @param string $id Identifier of the entry to look for.
     *
     * @throws NotFoundExceptionInterface  No entry was found for **this** identifier.
     * @throws ContainerExceptionInterface Error while retrieving the entry.
     *
     * @return mixed Entry.
     */
    public function get(string $id);

    /**
     * Returns true if the container can return an entry for the given identifier.
     * Returns false otherwise.
     *
     * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
     * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
     *
     * @param string $id Identifier of the entry to look for.
     *
     * @return bool
     */
    public function has(string $id): bool;
}


================================================
FILE: src/NotFoundExceptionInterface.php
================================================
<?php

namespace Psr\Container;

/**
 * No entry was found in the container.
 */
interface NotFoundExceptionInterface extends ContainerExceptionInterface
{
}
Download .txt
gitextract_siiew8ni/

├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── composer.json
└── src/
    ├── ContainerExceptionInterface.php
    ├── ContainerInterface.php
    └── NotFoundExceptionInterface.php
Download .txt
SYMBOL INDEX (5 symbols across 3 files)

FILE: src/ContainerExceptionInterface.php
  type ContainerExceptionInterface (line 10) | interface ContainerExceptionInterface extends Throwable

FILE: src/ContainerInterface.php
  type ContainerInterface (line 10) | interface ContainerInterface
    method get (line 22) | public function get(string $id);
    method has (line 35) | public function has(string $id): bool;

FILE: src/NotFoundExceptionInterface.php
  type NotFoundExceptionInterface (line 8) | interface NotFoundExceptionInterface extends ContainerExceptionInterface
Condensed preview — 8 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5K chars).
[
  {
    "path": ".gitattributes",
    "chars": 60,
    "preview": ".gitattributes  export-ignore\n.gitignore      export-ignore\n"
  },
  {
    "path": ".gitignore",
    "chars": 37,
    "preview": "composer.lock\ncomposer.phar\n/vendor/\n"
  },
  {
    "path": "LICENSE",
    "chars": 1145,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2013-2016 container-interop\nCopyright (c) 2016 PHP Framework Interoperability Group"
  },
  {
    "path": "README.md",
    "chars": 578,
    "preview": "Container interface\n==============\n\nThis repository holds all interfaces related to [PSR-11 (Container Interface)][psr-u"
  },
  {
    "path": "composer.json",
    "chars": 736,
    "preview": "{\n    \"name\": \"psr/container\",\n    \"type\": \"library\",\n    \"description\": \"Common Container Interface (PHP FIG PSR-11)\",\n"
  },
  {
    "path": "src/ContainerExceptionInterface.php",
    "chars": 184,
    "preview": "<?php\n\nnamespace Psr\\Container;\n\nuse Throwable;\n\n/**\n * Base interface representing a generic exception in a container.\n"
  },
  {
    "path": "src/ContainerInterface.php",
    "chars": 1046,
    "preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Psr\\Container;\n\n/**\n * Describes the interface of a container that exposes me"
  },
  {
    "path": "src/NotFoundExceptionInterface.php",
    "chars": 158,
    "preview": "<?php\n\nnamespace Psr\\Container;\n\n/**\n * No entry was found in the container.\n */\ninterface NotFoundExceptionInterface ex"
  }
]

About this extraction

This page contains the full source code of the php-fig/container GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 8 files (3.9 KB), approximately 1.1k tokens, and a symbol index with 5 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!