Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 15... Línea 15...
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
namespace core\hook;
17
namespace core\hook;
-
 
18
 
18
 
19
use DI\ContainerBuilder;
Línea 19... Línea 20...
19
use DI\ContainerBuilder;
20
use DI\Definition;
20
use core\attribute\label;
21
use core\attribute\label;
21
 
22
 
Línea 65... Línea 66...
65
     *     },
66
     *     },
66
     *  );
67
     *  );
67
     * </code>
68
     * </code>
68
     *
69
     *
69
     * @param string $id The identifier of the container entry
70
     * @param string $id The identifier of the container entry
-
 
71
     * @param callable|Definition\Definition|Definition\SelfResolvingDefinition|Definition\Helper\DefinitionHelper $definition
70
     * @param callable $definition The definition of the container entry
72
     *     The definition of the container entry
71
     * @return self
73
     * @return self
72
     * @example
74
     * @example
73
     */
75
     */
74
    public function add_definition(
76
    public function add_definition(
75
        string $id,
77
        string $id,
76
        callable $definition,
78
        callable|Definition\Definition|Definition\SelfResolvingDefinition|Definition\Helper\DefinitionHelper $definition,
77
    ): self {
79
    ): self {
78
        $this->builder->addDefinitions([
80
        $this->builder->addDefinitions([
79
            $id => $definition,
81
            $id => $definition,
80
        ]);
82
        ]);