2017 © Pedro PelĂĄez
 

library classy

Provides a way to collect classy constructs from source or a directory.

image

localheinz/classy

Provides a way to collect classy constructs from source or a directory.

  • Saturday, January 27, 2018
  • by localheinz
  • Repository
  • 1 Watchers
  • 2 Stars
  • 13,117 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 28 % Grown

The README.md

classy

Integrate Merge Release Renew, (*1)

Code Coverage Type Coverage, (*2)

Latest Stable Version Total Downloads Monthly Downloads, (*3)

This project provides a composer package with a finder for classy constructs (classes, enums, interfaces, and traits)., (*4)

Installation

Run, (*5)

composer require ergebnis/classy

Usage

Collect classy constructs from source code

Use Classy\Constructs::fromSource() to collect classy constructs in source code:, (*6)

<?php

declare(strict_types=1);

use Ergebnis\Classy;

$source = <<<'PHP'
<?php

namespace Example;

class Foo {}

enum Bar {}

interface Baz {}

trait Qux {}
PHP;

$constructs = Classy\Constructs::fromSource($source);

$names = array_map(static function (Classy\Construct $construct): string {
    return $construct->name();
}, $constructs);

var_dump($names); // ['Example\Bar', 'Example\Baz', 'Example\Foo', 'Example\Qux']

Collect classy constructs from a directory

Use Classy\Constructs::fromDirectory() to collect classy constructs in a directory:, (*7)

<?php

declare(strict_types=1);

use Ergebnis\Classy;

$constructs = Classy\Constructs::fromDirectory(__DIR__ . '/example');

$names = array_map(static function (Classy\Construct $construct): string {
    return $construct->name();
}, $constructs);

var_dump($names); // ['Example\Bar', 'Example\Bar\Baz', 'Example\Foo\Bar\Baz']

Changelog

The maintainers of this project record notable changes to this project in a changelog., (*8)

Contributing

The maintainers of this project suggest following the contribution guide., (*9)

Code of Conduct

The maintainers of this project ask contributors to follow the code of conduct., (*10)

General Support Policy

The maintainers of this project provide limited support., (*11)

You can support the maintenance of this project by sponsoring @localheinz or requesting an invoice for services related to this project., (*12)

PHP Version Support Policy

This project supports PHP versions with active and security support., (*13)

The maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support., (*14)

Security Policy

This project has a security policy., (*15)

License

This project uses the MIT license., (*16)

Credits

The algorithm for finding classes in PHP files in Constructs has been adopted from Zend\File\ClassFileLocator (originally licensed under BSD-3-Clause)., (*17)

Social

Follow @localheinz and @ergebnis on Twitter., (*18)

The Versions

27/01 2018

dev-master

9999999-dev https://github.com/localheinz/classy

Provides a way to collect classy constructs from source or a directory.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

24/10 2017

0.3.0

0.3.0.0

Provides a way to collect classy constructs from source or a directory.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

10/10 2017

0.2.0

0.2.0.0

Provides a way to collect classy constructs from source or a directory.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

05/10 2017

0.1.0

0.1.0.0

Provides a way to collect classy constructs from source or a directory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller