Composer\Installers\Installer::supports PHP Method

supports() public method

{@inheritDoc}
public supports ( $packageType )
    public function supports($packageType)
    {
        $frameworkType = $this->findFrameworkType($packageType);
        if ($frameworkType === false) {
            return false;
        }
        $locationPattern = $this->getLocationPattern($frameworkType);
        return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * testSupports
  *
  * @return void
  *
  * @dataProvider dataForTestSupport
  */
 public function testSupports($type, $expected)
 {
     $installer = new Installer($this->io, $this->composer);
     $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
 }