当前位置: 首页>>代码示例>>PHP>>正文


PHP Expr::endsWith方法代码示例

本文整理汇总了PHP中Webmozart\Expression\Expr::endsWith方法的典型用法代码示例。如果您正苦于以下问题:PHP Expr::endsWith方法的具体用法?PHP Expr::endsWith怎么用?PHP Expr::endsWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Webmozart\Expression\Expr的用法示例。


在下文中一共展示了Expr::endsWith方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: leaveExpression

 /**
  * {@inheritdoc}
  */
 public function leaveExpression(Expression $expr)
 {
     if ($expr instanceof Method) {
         switch ($expr->getMethodName()) {
             case 'getUuid':
                 return Expr::method('getUuid', $expr->getExpression());
             case 'getGlob':
                 $queryExpr = $expr->getExpression();
                 if ($queryExpr instanceof Same) {
                     $queryExpr = Expr::same($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof Equals) {
                     $queryExpr = Expr::equals($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof NotSame) {
                     $queryExpr = Expr::notSame($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof NotEquals) {
                     $queryExpr = Expr::notEquals($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof EndsWith) {
                     $queryExpr = Expr::endsWith($queryExpr->getAcceptedSuffix() . '{,/**/*}');
                 }
                 return Expr::method('getBinding', Expr::method('getQuery', $queryExpr));
             case 'getServerName':
                 return Expr::method('getParameterValue', DiscoveryUrlGenerator::SERVER_PARAMETER, $expr->getExpression());
             case 'getServerPath':
                 return Expr::method('getParameterValue', DiscoveryUrlGenerator::PATH_PARAMETER, $expr->getExpression());
         }
     }
     return $expr;
 }
开发者ID:SenseException,项目名称:manager,代码行数:31,代码来源:BindingExpressionBuilder.php

示例2: orEndsWith

 public function orEndsWith($suffix)
 {
     return $this->orX(Expr::endsWith($suffix));
 }
开发者ID:webmozart,项目名称:expression,代码行数:4,代码来源:OrX.php

示例3: testAppendDefaultQuerySuffixForEndsWith

 public function testAppendDefaultQuerySuffixForEndsWith()
 {
     $expr1 = Expr::endsWith('.css', AssetMapping::GLOB);
     $expr2 = Expr::same(BindingState::ENABLED, BindingDescriptor::STATE)->andSame(DiscoveryUrlGenerator::BINDING_TYPE, BindingDescriptor::TYPE_NAME)->andEndsWith('{,/**/*}', BindingDescriptor::QUERY)->andEndsWith('.css{,/**/*}', BindingDescriptor::QUERY);
     $this->assertEquals($expr2, $this->builder->buildExpression($expr1));
 }
开发者ID:niklongstone,项目名称:manager,代码行数:6,代码来源:BindingExpressionBuilderTest.php

示例4: leaveExpression

 /**
  * {@inheritdoc}
  */
 public function leaveExpression(Expression $expr)
 {
     if ($expr instanceof Key) {
         switch ($expr->getKey()) {
             case AssetMapping::UUID:
                 return Expr::key(BindingDescriptor::UUID, $expr->getExpression());
             case AssetMapping::GLOB:
                 $queryExpr = $expr->getExpression();
                 if ($queryExpr instanceof Same) {
                     $queryExpr = Expr::same($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof Equals) {
                     $queryExpr = Expr::equals($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof NotSame) {
                     $queryExpr = Expr::notSame($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof NotEquals) {
                     $queryExpr = Expr::notEquals($queryExpr->getComparedValue() . '{,/**/*}');
                 } elseif ($queryExpr instanceof EndsWith) {
                     $queryExpr = Expr::endsWith($queryExpr->getAcceptedSuffix() . '{,/**/*}');
                 }
                 return Expr::key(BindingDescriptor::QUERY, $queryExpr);
             case AssetMapping::SERVER_NAME:
                 return Expr::key(BindingDescriptor::PARAMETER_VALUES, Expr::key(DiscoveryUrlGenerator::SERVER_PARAMETER, $expr->getExpression()));
             case AssetMapping::SERVER_PATH:
                 return Expr::key(BindingDescriptor::PARAMETER_VALUES, Expr::key(DiscoveryUrlGenerator::PATH_PARAMETER, $expr->getExpression()));
         }
     }
     return $expr;
 }
开发者ID:niklongstone,项目名称:manager,代码行数:31,代码来源:BindingExpressionBuilder.php

示例5: testFindRootInstallerDescriptors

 public function testFindRootInstallerDescriptors()
 {
     $this->populateRootManager();
     $descriptor1 = new InstallerDescriptor('symlink', 'SymlinkInstaller');
     $descriptor2 = new InstallerDescriptor('copy', 'CopyInstaller');
     $expr1 = Expr::same('symlink', InstallerDescriptor::NAME);
     $expr2 = Expr::endsWith('Installer', InstallerDescriptor::CLASS_NAME);
     $this->assertEquals(array($descriptor1), $this->manager->findRootInstallerDescriptors($expr1));
     $this->assertEquals(array($descriptor1, $descriptor2), $this->manager->findRootInstallerDescriptors($expr2));
 }
开发者ID:puli,项目名称:asset-plugin,代码行数:10,代码来源:PackageFileInstallerManagerUnloadedTest.php

示例6: testRemovePackages

 public function testRemovePackages()
 {
     $this->initDefaultManager();
     $packageDir = $this->packageDir1;
     $this->packageFileStorage->expects($this->once())->method('saveRootPackageFile')->with($this->rootPackageFile)->will($this->returnCallback(function (RootPackageFile $rootPackageFile) use($packageDir) {
         PHPUnit_Framework_Assert::assertFalse($rootPackageFile->hasInstallInfo('vendor/package1'));
         PHPUnit_Framework_Assert::assertFalse($rootPackageFile->hasInstallInfo('vendor/package2'));
         PHPUnit_Framework_Assert::assertTrue($rootPackageFile->hasInstallInfo('vendor/package3'));
     }));
     $this->rootPackageFile->addInstallInfo($this->installInfo3);
     $this->assertTrue($this->rootPackageFile->hasInstallInfo('vendor/package1'));
     $this->assertTrue($this->rootPackageFile->hasInstallInfo('vendor/package2'));
     $this->assertTrue($this->rootPackageFile->hasInstallInfo('vendor/package3'));
     $this->assertTrue($this->manager->hasPackage('vendor/root'));
     $this->assertTrue($this->manager->hasPackage('vendor/package1'));
     $this->assertTrue($this->manager->hasPackage('vendor/package2'));
     $this->assertTrue($this->manager->hasPackage('vendor/package3'));
     $this->manager->removePackages(Expr::key(Package::NAME, Expr::endsWith('1')->orEndsWith('2')));
     $this->assertFalse($this->rootPackageFile->hasInstallInfo('vendor/package1'));
     $this->assertFalse($this->rootPackageFile->hasInstallInfo('vendor/package2'));
     $this->assertTrue($this->rootPackageFile->hasInstallInfo('vendor/package3'));
     $this->assertTrue($this->manager->hasPackage('vendor/root'));
     $this->assertFalse($this->manager->hasPackage('vendor/package1'));
     $this->assertFalse($this->manager->hasPackage('vendor/package2'));
     $this->assertTrue($this->manager->hasPackage('vendor/package3'));
 }
开发者ID:kormik,项目名称:manager,代码行数:26,代码来源:PackageManagerImplTest.php

示例7: andEndsWith

 public function andEndsWith($suffix)
 {
     return $this->andX(Expr::endsWith($suffix));
 }
开发者ID:webmozart,项目名称:expression,代码行数:4,代码来源:AndX.php


注:本文中的Webmozart\Expression\Expr::endsWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。