2017 © Pedro Peláez
 

library container

PHP Container

image

vim/container

PHP Container

  • Thursday, June 14, 2018
  • by vanvas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 20 % Grown

The README.md

container

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org., (*1)

composer require vim/container

Example:

<?php

namespace App\Container;

class ExampleContainer
{
    /**
     * @var mixed
     */
    private $property1;

    /**
     * @var mixed
     * @cName("key_for_property2")
     */
    private $property2;

    /**
     * @var \App\Container\ExampleProperty3Container
     * @cName("key_for_property3")
     * @cEmbedded("\App\Container\ExampleProperty3Container")
     */
    private $property3;

    /**
     * @var \App\Container\ExampleProperty4Container[]|\ArrayIterator
     * @cEmbedded("\App\Container\ExampleProperty4Container[]")
     */
    private $property4;

    /**
     * @var
     * @cType("datetime")
     */
    private $property5;

    /**
     * @return mixed
     */
    public function getProperty1()
    {
        return $this->property1;
    }

    /**
     * @return mixed
     */
    public function getProperty2()
    {
        return $this->property2;
    }

    /**
     * @return \App\Container\ExampleProperty3Container
     */
    public function getProperty3(): \App\Container\ExampleProperty3Container
    {
        return $this->property3;
    }

    /**
     * @return \App\Container\ExampleProperty4Container[]|\ArrayIterator
     */
    public function getProperty4(): \ArrayIterator
    {
        return $this->property4;
    }

    /**
     * @return mixed
     */
    public function getProperty5()
    {
        return $this->property5;
    }
}
<?php
$containerService = new \Vim\Container\ContainerService();

$container = $containerService->createContainer(
    [
        'property1' => 'value1',
        'key_for_property2' => 'value2',
        'key_for_property3' => ['another_container_property1' => 'another_container_value1'],
        'property4' => [['another_container_property1' => 'another_container_value1']],
        'property5' => '2012-01-01',
    ]
);

var_dump($container);

The Versions

14/06 2018

dev-master

9999999-dev https://github.com/vanvas/container.git

PHP Container

  Sources   Download

The Requires

  • php >=5.6

 

The Development Requires

container php

14/06 2018

2.0.0

2.0.0.0 https://github.com/vanvas/container.git

PHP Container

  Sources   Download

The Requires

  • php >=5.6

 

The Development Requires

container php

19/01 2018

1.0.0

1.0.0.0 https://github.com/vanvas/container.git

PHP Container

  Sources   Download

The Requires

  • php >=5.6

 

container php