Skip to content

Instantly share code, notes, and snippets.

@koriym
Last active November 28, 2019 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koriym/0884cae2615d9161a570763950ea9f40 to your computer and use it in GitHub Desktop.
Save koriym/0884cae2615d9161a570763950ea9f40 to your computer and use it in GitHub Desktop.
公開領域だけ @publicdomain アノテーションをつけてその他は認証するための束縛
<?php
public function configure()
{
$this->bindInterceptor(
$this->matcher->logicalAnd(
$this->matcher->logicalAnd(
$this->matcher->logicalNot(
$this->matcher->annotatedWith(PublicDomain::class)
),
$this->matcher->subclassesOf(ResourceObject::class)
),
$this->matcher->startsWith('MyVendor')
),
$this->matcher->startsWith('on'),
[AuthInterceptor::class]
);
}
// 公開領域だけ@PublicDomainアノテーションをつけてその他は認証するための束縛
// MyVendorクラスのResourceObjectで`PublicDomain`アノテーションがついていないonメソッドに認証用のAuthInterceptorを束縛
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment