Complex classes like FunFunFactory often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use FunFunFactory, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 154 | class FunFunFactory { |
||
| 155 | |||
| 156 | private $config; |
||
| 157 | |||
| 158 | /** |
||
| 159 | * @var \Pimple |
||
| 160 | */ |
||
| 161 | private $pimple; |
||
| 162 | |||
| 163 | private $addDoctrineSubscribers = true; |
||
| 164 | |||
| 165 | /** |
||
| 166 | * @var Stopwatch|null |
||
| 167 | */ |
||
| 168 | private $profiler = null; |
||
| 169 | |||
| 170 | public function __construct( array $config ) { |
||
| 171 | $this->config = $config; |
||
| 172 | $this->pimple = $this->newPimple(); |
||
| 173 | } |
||
| 174 | |||
| 175 | private function newPimple(): \Pimple { |
||
| 176 | $pimple = new \Pimple(); |
||
| 177 | |||
| 178 | $pimple['logger'] = $pimple->share( function() { |
||
| 179 | return new NullLogger(); |
||
| 180 | } ); |
||
| 181 | |||
| 182 | $pimple['dbal_connection'] = $pimple->share( function() { |
||
| 183 | return DriverManager::getConnection( $this->config['db'] ); |
||
| 184 | } ); |
||
| 185 | |||
| 186 | $pimple['entity_manager'] = $pimple->share( function() { |
||
| 187 | $entityManager = ( new StoreFactory( $this->getConnection() ) )->getEntityManager(); |
||
| 188 | if ( $this->addDoctrineSubscribers ) { |
||
| 189 | $entityManager->getEventManager()->addEventSubscriber( $this->newDoctrineDonationPrePersistSubscriber() ); |
||
| 190 | $entityManager->getEventManager()->addEventSubscriber( $this->newDoctrineMembershipApplicationPrePersistSubscriber() ); |
||
| 191 | } |
||
| 192 | |||
| 193 | return $entityManager; |
||
| 194 | } ); |
||
| 195 | |||
| 196 | $pimple['subscription_repository'] = $pimple->share( function() { |
||
| 197 | return new LoggingSubscriptionRepository( |
||
| 198 | new DoctrineSubscriptionRepository( $this->getEntityManager() ), |
||
| 199 | $this->getLogger() |
||
| 200 | ); |
||
| 201 | } ); |
||
| 202 | |||
| 203 | $pimple['donation_repository'] = $pimple->share( function() { |
||
| 204 | return new LoggingDonationRepository( |
||
| 205 | new DoctrineDonationRepository( $this->getEntityManager() ), |
||
| 206 | $this->getLogger() |
||
| 207 | ); |
||
| 208 | } ); |
||
| 209 | |||
| 210 | $pimple['membership_application_repository'] = $pimple->share( function() { |
||
| 211 | return new LoggingMembershipApplicationRepository( |
||
| 212 | new DoctrineMembershipApplicationRepository( $this->getEntityManager() ), |
||
| 213 | $this->getLogger() |
||
| 214 | ); |
||
| 215 | } ); |
||
| 216 | |||
| 217 | $pimple['comment_repository'] = $pimple->share( function() { |
||
| 218 | $finder = new LoggingCommentFinder( |
||
| 219 | new DoctrineCommentFinder( $this->getEntityManager() ), |
||
| 220 | $this->getLogger() |
||
| 221 | ); |
||
| 222 | |||
| 223 | return $this->addProfilingDecorator( $finder, 'CommentFinder' ); |
||
| 224 | } ); |
||
| 225 | |||
| 226 | $pimple['mail_validator'] = $pimple->share( function() { |
||
| 227 | return new EmailValidator( new InternetDomainNameValidator() ); |
||
| 228 | } ); |
||
| 229 | |||
| 230 | $pimple['subscription_validator'] = $pimple->share( function() { |
||
| 231 | return new SubscriptionValidator( |
||
| 232 | $this->getEmailValidator(), |
||
| 233 | $this->newTextPolicyValidator( 'fields' ), |
||
| 234 | $this->newSubscriptionDuplicateValidator(), |
||
| 235 | $this->newHonorificValidator() |
||
| 236 | ); |
||
| 237 | } ); |
||
| 238 | |||
| 239 | $pimple['template_name_validator'] = $pimple->share( function() { |
||
| 240 | return new TemplateNameValidator( $this->getTwig() ); |
||
| 241 | } ); |
||
| 242 | |||
| 243 | $pimple['contact_validator'] = $pimple->share( function() { |
||
| 244 | return new GetInTouchValidator( $this->getEmailValidator() ); |
||
| 245 | } ); |
||
| 246 | |||
| 247 | $pimple['greeting_generator'] = $pimple->share( function() { |
||
| 248 | return new GreetingGenerator(); |
||
| 249 | } ); |
||
| 250 | |||
| 251 | $pimple['mw_api'] = $pimple->share( function() { |
||
| 252 | return new MediawikiApi( |
||
| 253 | $this->config['cms-wiki-api-url'], |
||
| 254 | $this->getGuzzleClient() |
||
| 255 | ); |
||
| 256 | } ); |
||
| 257 | |||
| 258 | $pimple['guzzle_client'] = $pimple->share( function() { |
||
| 259 | $middlewareFactory = new MiddlewareFactory(); |
||
| 260 | $middlewareFactory->setLogger( $this->getLogger() ); |
||
| 261 | |||
| 262 | $handlerStack = HandlerStack::create( new CurlHandler() ); |
||
| 263 | $handlerStack->push( $middlewareFactory->retry() ); |
||
| 264 | |||
| 265 | $guzzle = new Client( [ |
||
| 266 | 'cookies' => true, |
||
| 267 | 'handler' => $handlerStack, |
||
| 268 | 'headers' => [ 'User-Agent' => 'WMDE Fundraising Frontend' ], |
||
| 269 | ] ); |
||
| 270 | |||
| 271 | return $this->addProfilingDecorator( $guzzle, 'Guzzle Client' ); |
||
| 272 | } ); |
||
| 273 | |||
| 274 | $pimple['translator'] = $pimple->share( function() { |
||
| 275 | $translationFactory = new TranslationFactory(); |
||
| 276 | $loaders = [ |
||
| 277 | 'json' => $translationFactory->newJsonLoader() |
||
| 278 | ]; |
||
| 279 | $locale = $this->config['locale']; |
||
| 280 | $translator = $translationFactory->create( $loaders, $locale ); |
||
| 281 | $translator->addResource( |
||
| 282 | 'json', |
||
| 283 | __DIR__ . '/../../app/translations/messages.' . $locale . '.json', |
||
| 284 | $locale |
||
| 285 | ); |
||
| 286 | |||
| 287 | $translator->addResource( |
||
| 288 | 'json', |
||
| 289 | __DIR__ . '/../../app/translations/paymentTypes.' . $locale . '.json', |
||
| 290 | $locale, |
||
| 291 | 'paymentTypes' |
||
| 292 | ); |
||
| 293 | |||
| 294 | $translator->addResource( |
||
| 295 | 'json', |
||
| 296 | __DIR__ . '/../../app/translations/paymentIntervals.' . $locale . '.json', |
||
| 297 | $locale, |
||
| 298 | 'paymentIntervals' |
||
| 299 | ); |
||
| 300 | |||
| 301 | $translator->addResource( |
||
| 302 | 'json', |
||
| 303 | __DIR__ . '/../../app/translations/donationStatus.' . $locale . '.json', |
||
| 304 | $locale, |
||
| 305 | 'donationStatus' |
||
| 306 | ); |
||
| 307 | |||
| 308 | $translator->addResource( |
||
| 309 | 'json', |
||
| 310 | __DIR__ . '/../../app/translations/validations.' . $locale . '.json', |
||
| 311 | $locale, |
||
| 312 | 'validations' |
||
| 313 | ); |
||
| 314 | |||
| 315 | return $translator; |
||
| 316 | } ); |
||
| 317 | |||
| 318 | // In the future, this could be locale-specific or filled from a DB table |
||
| 319 | $pimple['honorifics'] = $pimple->share( function() { |
||
| 320 | return new Honorifics( [ |
||
| 321 | '' => 'Kein Titel', |
||
| 322 | 'Dr.' => 'Dr.', |
||
| 323 | 'Prof.' => 'Prof.', |
||
| 324 | 'Prof. Dr.' => 'Prof. Dr.' |
||
| 325 | ] ); |
||
| 326 | } ); |
||
| 327 | |||
| 328 | $pimple['twig_factory'] = $pimple->share( function () { |
||
| 329 | return new TwigFactory( $this->config['twig'], $this->getCachePath() . '/twig' ); |
||
| 330 | } ); |
||
| 331 | |||
| 332 | $pimple['twig'] = $pimple->share( function() { |
||
| 333 | $twigFactory = $this->getTwigFactory(); |
||
| 334 | $loaders = array_filter( [ |
||
| 335 | $twigFactory->newFileSystemLoader(), |
||
| 336 | $twigFactory->newArrayLoader(), // This is just a fallback for testing |
||
| 337 | $twigFactory->newWikiPageLoader( $this->newWikiPageRetriever() ), |
||
| 338 | ] ); |
||
| 339 | $extensions = [ |
||
| 340 | $twigFactory->newTranslationExtension( $this->getTranslator() ), |
||
| 341 | new Twig_Extensions_Extension_Intl() |
||
| 342 | ]; |
||
| 343 | |||
| 344 | return $twigFactory->create( $loaders, $extensions ); |
||
| 345 | } ); |
||
| 346 | |||
| 347 | $pimple['messenger'] = $pimple->share( function() { |
||
| 348 | return new Messenger( |
||
| 349 | new Swift_MailTransport(), |
||
| 350 | $this->getOperatorAddress(), |
||
| 351 | $this->config['operator-displayname'] |
||
| 352 | ); |
||
| 353 | } ); |
||
| 354 | |||
| 355 | $pimple['confirmation-page-selector'] = $pimple->share( function() { |
||
| 356 | return new DonationConfirmationPageSelector( $this->config['confirmation-pages'] ); |
||
| 357 | } ); |
||
| 358 | |||
| 359 | $pimple['paypal-payment-notification-verifier'] = $pimple->share( function() { |
||
| 360 | return new LoggingPaymentNotificationVerifier( |
||
| 361 | new PayPalPaymentNotificationVerifier( |
||
| 362 | new Client(), |
||
| 363 | $this->config['paypal'] |
||
| 364 | ), |
||
| 365 | $this->getLogger() |
||
| 366 | ); |
||
| 367 | } ); |
||
| 368 | |||
| 369 | $pimple['credit-card-api-service'] = $pimple->share( function() { |
||
| 370 | return new McpCreditCardService( |
||
| 371 | new TNvpServiceDispatcher( |
||
| 372 | 'IMcpCreditcardService_v1_5', |
||
| 373 | 'https://sipg.micropayment.de/public/creditcard/v1.5/nvp/' |
||
| 374 | ), |
||
| 375 | $this->config['creditcard']['access-key'], |
||
| 376 | $this->config['creditcard']['testmode'] |
||
| 377 | ); |
||
| 378 | } ); |
||
| 379 | |||
| 380 | $pimple['token_generator'] = $pimple->share( function() { |
||
| 381 | return new RandomTokenGenerator( |
||
| 382 | $this->config['token-length'], |
||
| 383 | new \DateInterval( $this->config['token-validity-timestamp'] ) |
||
| 384 | ); |
||
| 385 | } ); |
||
| 386 | |||
| 387 | $pimple['page_cache'] = $pimple->share( function() { |
||
| 388 | return new VoidCache(); |
||
| 389 | } ); |
||
| 390 | |||
| 391 | return $pimple; |
||
| 392 | } |
||
| 393 | |||
| 394 | public function getConnection(): Connection { |
||
| 395 | return $this->pimple['dbal_connection']; |
||
| 396 | } |
||
| 397 | |||
| 398 | public function getEntityManager(): EntityManager { |
||
| 399 | return $this->pimple['entity_manager']; |
||
| 400 | } |
||
| 401 | |||
| 402 | private function newDonationEventLogger(): DonationEventLogger { |
||
| 403 | return new BestEffortDonationEventLogger( |
||
| 404 | new DoctrineDonationEventLogger( $this->getEntityManager() ), |
||
| 405 | $this->getLogger() |
||
| 406 | ); |
||
| 407 | } |
||
| 408 | |||
| 409 | public function newInstaller(): Installer { |
||
| 410 | return ( new StoreFactory( $this->getConnection() ) )->newInstaller(); |
||
| 411 | } |
||
| 412 | |||
| 413 | public function newListCommentsUseCase(): ListCommentsUseCase { |
||
| 414 | return new ListCommentsUseCase( $this->getCommentFinder() ); |
||
| 415 | } |
||
| 416 | |||
| 417 | public function newCommentListJsonPresenter(): CommentListJsonPresenter { |
||
| 418 | return new CommentListJsonPresenter(); |
||
| 419 | } |
||
| 420 | |||
| 421 | public function newCommentListRssPresenter(): CommentListRssPresenter { |
||
| 422 | return new CommentListRssPresenter( new TwigTemplate( |
||
| 423 | $this->getTwig(), |
||
| 424 | 'CommentList.rss.twig' |
||
| 425 | ) ); |
||
| 426 | } |
||
| 427 | |||
| 428 | public function newCommentListHtmlPresenter(): CommentListHtmlPresenter { |
||
| 429 | return new CommentListHtmlPresenter( $this->getLayoutTemplate( 'CommentList.html.twig' ) ); |
||
| 430 | } |
||
| 431 | |||
| 432 | private function getCommentFinder(): CommentFinder { |
||
| 433 | return $this->pimple['comment_repository']; |
||
| 434 | } |
||
| 435 | |||
| 436 | public function getSubscriptionRepository(): SubscriptionRepository { |
||
| 437 | return $this->pimple['subscription_repository']; |
||
| 438 | } |
||
| 439 | |||
| 440 | public function setSubscriptionRepository( SubscriptionRepository $subscriptionRepository ) { |
||
| 441 | $this->pimple['subscription_repository'] = $subscriptionRepository; |
||
| 442 | } |
||
| 443 | |||
| 444 | private function getSubscriptionValidator(): SubscriptionValidator { |
||
| 445 | return $this->pimple['subscription_validator']; |
||
| 446 | } |
||
| 447 | |||
| 448 | public function getEmailValidator(): EmailValidator { |
||
| 449 | return $this->pimple['mail_validator']; |
||
| 450 | } |
||
| 451 | |||
| 452 | private function getTemplateNameValidator(): TemplateNameValidator { |
||
| 453 | return $this->pimple['template_name_validator']; |
||
| 454 | } |
||
| 455 | |||
| 456 | public function newDisplayPageUseCase(): DisplayPageUseCase { |
||
| 457 | return new DisplayPageUseCase( |
||
| 458 | $this->getTemplateNameValidator() |
||
| 459 | ); |
||
| 460 | } |
||
| 461 | |||
| 462 | public function newDisplayPagePresenter(): DisplayPagePresenter { |
||
| 463 | return new DisplayPagePresenter( $this->getLayoutTemplate( 'DisplayPageLayout.twig' ) ); |
||
| 464 | } |
||
| 465 | |||
| 466 | public function newAddSubscriptionHTMLPresenter(): AddSubscriptionHtmlPresenter { |
||
| 467 | return new AddSubscriptionHtmlPresenter( $this->getIncludeTemplate( 'Subscription_Form.twig' ), $this->getTranslator() ); |
||
| 468 | } |
||
| 469 | |||
| 470 | public function newConfirmSubscriptionHtmlPresenter(): ConfirmSubscriptionHtmlPresenter { |
||
| 471 | return new ConfirmSubscriptionHtmlPresenter( |
||
| 472 | $this->getLayoutTemplate( 'ConfirmSubscription.html.twig' ), |
||
| 473 | $this->getTranslator() |
||
| 474 | ); |
||
| 475 | } |
||
| 476 | |||
| 477 | public function newAddSubscriptionJSONPresenter(): AddSubscriptionJsonPresenter { |
||
| 478 | return new AddSubscriptionJsonPresenter( $this->getTranslator() ); |
||
| 479 | } |
||
| 480 | |||
| 481 | public function newGetInTouchHTMLPresenter(): GetInTouchHtmlPresenter { |
||
| 482 | return new GetInTouchHtmlPresenter( $this->getIncludeTemplate( 'Kontaktformular.twig' ), $this->getTranslator() ); |
||
| 483 | } |
||
| 484 | |||
| 485 | public function getTwig(): Twig_Environment { |
||
| 486 | return $this->pimple['twig']; |
||
| 487 | } |
||
| 488 | |||
| 489 | /** |
||
| 490 | * Get a template, with the content for the layout areas filled in. |
||
| 491 | * |
||
| 492 | * @param string $templateName |
||
| 493 | * @return TwigTemplate |
||
| 494 | */ |
||
| 495 | private function getLayoutTemplate( string $templateName ): TwigTemplate { |
||
| 496 | return new TwigTemplate( |
||
| 497 | $this->getTwig(), |
||
| 498 | $templateName, |
||
| 499 | $this->getDefaultTwigVariables() |
||
| 500 | ); |
||
| 501 | } |
||
| 502 | |||
| 503 | /** |
||
| 504 | * Get a layouted template that includes another template |
||
| 505 | * |
||
| 506 | * @param string $templateName Template to include |
||
| 507 | * @return TwigTemplate |
||
| 508 | */ |
||
| 509 | private function getIncludeTemplate( string $templateName ): TwigTemplate { |
||
| 510 | return new TwigTemplate( |
||
| 511 | $this->getTwig(), |
||
| 512 | 'IncludeInLayout.twig', |
||
| 513 | array_merge( |
||
| 514 | $this->getDefaultTwigVariables(), |
||
| 515 | [ 'main_template' => $templateName ] |
||
| 516 | ) |
||
| 517 | ); |
||
| 518 | } |
||
| 519 | |||
| 520 | private function getDefaultTwigVariables() { |
||
| 521 | return [ |
||
| 522 | 'basepath' => $this->config['web-basepath'], |
||
| 523 | 'honorifics' => $this->getHonorifics()->getList(), |
||
| 524 | 'header_template' => $this->config['default-layout-templates']['header'], |
||
| 525 | 'footer_template' => $this->config['default-layout-templates']['footer'], |
||
| 526 | 'no_js_notice_template' => $this->config['default-layout-templates']['no-js-notice'], |
||
| 527 | ]; |
||
| 528 | } |
||
| 529 | |||
| 530 | private function newReferrerGeneralizer() { |
||
| 531 | return new ReferrerGeneralizer( |
||
| 532 | $this->config['referrer-generalization']['default'], |
||
| 533 | $this->config['referrer-generalization']['domain-map'] |
||
| 534 | ); |
||
| 535 | } |
||
| 536 | |||
| 537 | private function getMediaWikiApi(): MediawikiApi { |
||
| 538 | return $this->pimple['mw_api']; |
||
| 539 | } |
||
| 540 | |||
| 541 | public function setMediaWikiApi( MediawikiApi $api ) { |
||
| 542 | $this->pimple['mw_api'] = $api; |
||
| 543 | } |
||
| 544 | |||
| 545 | private function getGuzzleClient(): ClientInterface { |
||
| 546 | return $this->pimple['guzzle_client']; |
||
| 547 | } |
||
| 548 | |||
| 549 | private function newWikiPageRetriever(): PageRetriever { |
||
| 550 | $PageRetriever = new ModifyingPageRetriever( |
||
| 551 | $this->newCachedPageRetriever(), |
||
| 552 | $this->newPageContentModifier(), |
||
| 553 | $this->config['cms-wiki-title-prefix'] |
||
| 554 | ); |
||
| 555 | |||
| 556 | return $this->addProfilingDecorator( $PageRetriever, 'PageRetriever' ); |
||
| 557 | } |
||
| 558 | |||
| 559 | private function newCachedPageRetriever(): PageRetriever { |
||
| 560 | return new CachingPageRetriever( |
||
| 561 | $this->newNonCachedApiPageRetriever(), |
||
| 562 | $this->getPageCache() |
||
| 563 | ); |
||
| 564 | } |
||
| 565 | |||
| 566 | private function newNonCachedApiPageRetriever(): PageRetriever { |
||
| 567 | return new ApiBasedPageRetriever( |
||
| 568 | $this->getMediaWikiApi(), |
||
| 569 | new ApiUser( $this->config['cms-wiki-user'], $this->config['cms-wiki-password'] ), |
||
| 570 | $this->getLogger() |
||
| 571 | ); |
||
| 572 | } |
||
| 573 | |||
| 574 | public function getLogger(): LoggerInterface { |
||
| 575 | return $this->pimple['logger']; |
||
| 576 | } |
||
| 577 | |||
| 578 | private function getVarPath(): string { |
||
| 579 | return __DIR__ . '/../../var'; |
||
| 580 | } |
||
| 581 | |||
| 582 | public function getCachePath(): string { |
||
| 583 | return $this->getVarPath() . '/cache'; |
||
| 584 | } |
||
| 585 | |||
| 586 | public function getLoggingPath(): string { |
||
| 587 | return $this->getVarPath() . '/log'; |
||
| 588 | } |
||
| 589 | |||
| 590 | private function newPageContentModifier(): PageContentModifier { |
||
| 591 | return new PageContentModifier( |
||
| 592 | $this->getLogger() |
||
| 593 | ); |
||
| 594 | } |
||
| 595 | |||
| 596 | public function newAddSubscriptionUseCase(): AddSubscriptionUseCase { |
||
| 597 | return new AddSubscriptionUseCase( |
||
| 598 | $this->getSubscriptionRepository(), |
||
| 599 | $this->getSubscriptionValidator(), |
||
| 600 | $this->newAddSubscriptionMailer() |
||
| 601 | ); |
||
| 602 | } |
||
| 603 | |||
| 604 | public function newConfirmSubscriptionUseCase(): ConfirmSubscriptionUseCase { |
||
| 605 | return new ConfirmSubscriptionUseCase( |
||
| 606 | $this->getSubscriptionRepository(), |
||
| 607 | $this->newConfirmSubscriptionMailer() |
||
| 608 | ); |
||
| 609 | } |
||
| 610 | |||
| 611 | private function newAddSubscriptionMailer(): TemplateBasedMailer { |
||
| 612 | return $this->newTemplateMailer( |
||
| 613 | new TwigTemplate( |
||
| 614 | $this->getTwig(), |
||
| 615 | 'Mail_Subscription_Request.twig', |
||
| 616 | [ |
||
| 617 | 'basepath' => $this->config['web-basepath'], |
||
| 618 | 'greeting_generator' => $this->getGreetingGenerator() |
||
| 619 | ] |
||
| 620 | ), |
||
| 621 | 'mail_subject_membership' |
||
| 622 | ); |
||
| 623 | } |
||
| 624 | |||
| 625 | private function newConfirmSubscriptionMailer(): TemplateBasedMailer { |
||
| 626 | return $this->newTemplateMailer( |
||
| 627 | new TwigTemplate( |
||
| 628 | $this->getTwig(), |
||
| 629 | 'Mail_Subscription_Confirmation.twig', |
||
| 630 | [ 'greeting_generator' => $this->getGreetingGenerator() ] |
||
| 631 | ), |
||
| 632 | 'mail_subject_membership' |
||
| 633 | ); |
||
| 634 | } |
||
| 635 | |||
| 636 | private function newTemplateMailer( TwigTemplate $template, string $messageKey ): TemplateBasedMailer { |
||
| 637 | $mailer = new TemplateBasedMailer( |
||
| 638 | $this->getMessenger(), |
||
| 639 | $template, |
||
| 640 | $this->getTranslator()->trans( $messageKey ) |
||
| 641 | ); |
||
| 642 | |||
| 643 | $mailer = new LoggingMailer( $mailer, $this->getLogger() ); |
||
| 644 | |||
| 645 | return $this->addProfilingDecorator( $mailer, 'Mailer' ); |
||
| 646 | } |
||
| 647 | |||
| 648 | public function getGreetingGenerator() { |
||
| 651 | |||
| 652 | public function newCheckIbanUseCase(): CheckIbanUseCase { |
||
| 655 | |||
| 656 | public function newGenerateIbanUseCase(): GenerateIbanUseCase { |
||
| 659 | |||
| 660 | public function newIbanPresenter(): IbanPresenter { |
||
| 663 | |||
| 664 | public function newBankDataConverter() { |
||
| 667 | |||
| 668 | public function setSubscriptionValidator( SubscriptionValidator $subscriptionValidator ) { |
||
| 671 | |||
| 672 | public function setPageTitlePrefix( string $prefix ) { |
||
| 675 | |||
| 676 | public function newGetInTouchUseCase() { |
||
| 683 | |||
| 684 | private function newContactConfirmationMailer(): TemplateBasedMailer { |
||
| 690 | |||
| 691 | private function getContactValidator(): GetInTouchValidator { |
||
| 694 | |||
| 695 | private function newSubscriptionDuplicateValidator(): SubscriptionDuplicateValidator { |
||
| 701 | |||
| 702 | private function newSubscriptionDuplicateCutoffDate(): \DateTime { |
||
| 707 | |||
| 708 | private function newHonorificValidator(): AllowedValuesValidator { |
||
| 711 | |||
| 712 | private function getHonorifics(): Honorifics { |
||
| 715 | |||
| 716 | public function newPurgeCacheUseCase(): PurgeCacheUseCase { |
||
| 722 | |||
| 723 | private function newBankDataValidator(): BankDataValidator { |
||
| 726 | |||
| 727 | private function getMessenger(): Messenger { |
||
| 730 | |||
| 731 | public function setMessenger( Messenger $messenger ) { |
||
| 734 | |||
| 735 | public function setNullMessenger() { |
||
| 741 | |||
| 742 | public function getOperatorAddress() { |
||
| 745 | |||
| 746 | public function newInternalErrorHTMLPresenter(): InternalErrorHtmlPresenter { |
||
| 749 | |||
| 750 | public function newAccessDeniedHTMLPresenter(): InternalErrorHtmlPresenter { |
||
| 753 | |||
| 754 | public function getTranslator(): TranslatorInterface { |
||
| 757 | |||
| 758 | public function setTranslator( TranslatorInterface $translator ) { |
||
| 761 | |||
| 762 | private function getTwigFactory(): TwigFactory { |
||
| 765 | |||
| 766 | private function newTextPolicyValidator( string $policyName ): TextPolicyValidator { |
||
| 775 | |||
| 776 | private function newCommentPolicyValidator(): TextPolicyValidator { |
||
| 779 | |||
| 780 | public function newCancelDonationUseCase( string $updateToken ): CancelDonationUseCase { |
||
| 788 | |||
| 789 | private function newCancelDonationMailer(): TemplateBasedMailer { |
||
| 799 | |||
| 800 | public function newAddDonationUseCase(): AddDonationUseCase { |
||
| 811 | |||
| 812 | private function newBankTransferCodeGenerator(): TransferCodeGenerator { |
||
| 818 | |||
| 819 | private function newDonationValidator(): AddDonationValidator { |
||
| 826 | |||
| 827 | public function newPersonalInfoValidator(): PersonalInfoValidator { |
||
| 834 | |||
| 835 | private function newDonationConfirmationMailer(): DonationConfirmationMailer { |
||
| 850 | |||
| 851 | public function newPayPalUrlGenerator() { |
||
| 854 | |||
| 855 | private function getPayPalUrlConfig() { |
||
| 858 | |||
| 859 | private function newCreditCardUrlGenerator() { |
||
| 862 | |||
| 863 | private function newCreditCardUrlConfig() { |
||
| 866 | |||
| 867 | public function getDonationRepository(): DonationRepository { |
||
| 870 | |||
| 871 | public function newAmountValidator(): AmountValidator { |
||
| 874 | |||
| 875 | private function newAmountFormatter(): AmountFormatter { |
||
| 878 | |||
| 879 | public function newDecimalNumberFormatter(): NumberFormatter { |
||
| 882 | |||
| 883 | public function newAddCommentUseCase( string $updateToken ): AddCommentUseCase { |
||
| 891 | |||
| 892 | private function newDonationAuthorizer( string $updateToken = null, string $accessToken = null ): DonationAuthorizer { |
||
| 899 | |||
| 900 | public function getTokenGenerator(): TokenGenerator { |
||
| 903 | |||
| 904 | public function newDonationConfirmationPresenter() { |
||
| 909 | |||
| 910 | public function newCreditCardPaymentHtmlPresenter() { |
||
| 917 | |||
| 918 | public function newCancelDonationHtmlPresenter() { |
||
| 923 | |||
| 924 | public function newApplyForMembershipUseCase(): ApplyForMembershipUseCase { |
||
| 934 | |||
| 935 | private function newApplyForMembershipMailer(): TemplateBasedMailer { |
||
| 945 | |||
| 946 | private function newMembershipApplicationValidator(): MembershipApplicationValidator { |
||
| 953 | |||
| 954 | private function newMembershipApplicationTracker(): MembershipApplicationTracker { |
||
| 957 | |||
| 958 | private function newMembershipApplicationPiwikTracker(): MembershipApplicationPiwikTracker { |
||
| 961 | |||
| 962 | public function newCancelMembershipApplicationUseCase( string $updateToken ): CancelMembershipApplicationUseCase { |
||
| 969 | |||
| 970 | private function newMembershipApplicationAuthorizer( |
||
| 979 | |||
| 980 | public function getMembershipApplicationRepository(): MembershipApplicationRepository { |
||
| 983 | |||
| 984 | private function newCancelMembershipApplicationMailer(): TemplateBasedMailer { |
||
| 994 | |||
| 995 | public function newMembershipApplicationConfirmationUseCase( string $accessToken ) { |
||
| 1001 | |||
| 1002 | public function newShowDonationConfirmationUseCase( string $accessToken ): ShowDonationConfirmationUseCase { |
||
| 1008 | |||
| 1009 | public function setDonationConfirmationPageSelector( DonationConfirmationPageSelector $selector ) { |
||
| 1012 | |||
| 1013 | public function getDonationConfirmationPageSelector() { |
||
| 1016 | |||
| 1017 | public function newDonationFormViolationPresenter() { |
||
| 1024 | |||
| 1025 | public function newHandlePayPalPaymentNotificationUseCase( string $updateToken ) { |
||
| 1034 | |||
| 1035 | public function getPayPalPaymentNotificationVerifier(): PaymentNotificationVerifier { |
||
| 1038 | |||
| 1039 | public function setPayPalPaymentNotificationVerifier( PaymentNotificationVerifier $verifier ) { |
||
| 1042 | |||
| 1043 | public function newCreditCardNotificationUseCase( string $updateToken ) { |
||
| 1053 | |||
| 1054 | public function newCancelMembershipApplicationHtmlPresenter() { |
||
| 1059 | |||
| 1060 | public function newMembershipApplicationConfirmationHtmlPresenter() { |
||
| 1065 | |||
| 1066 | public function newMembershipFormViolationPresenter() { |
||
| 1071 | |||
| 1072 | public function setCreditCardService( CreditCardService $ccService ) { |
||
| 1075 | |||
| 1076 | public function getCreditCardService(): CreditCardService { |
||
| 1079 | |||
| 1080 | public function newCreditCardNotificationPresenter(): CreditCardNotificationPresenter { |
||
| 1089 | |||
| 1090 | private function newDoctrineDonationPrePersistSubscriber(): DoctrineDonationPrePersistSubscriber { |
||
| 1097 | |||
| 1098 | private function newDoctrineMembershipApplicationPrePersistSubscriber(): DoctrineMembershipApplicationPrePersistSubscriber { |
||
| 1105 | |||
| 1106 | public function setTokenGenerator( TokenGenerator $tokenGenerator ) { |
||
| 1109 | |||
| 1110 | public function disableDoctrineSubscribers() { |
||
| 1113 | |||
| 1114 | private function newDonationTokenFetcher(): DonationTokenFetcher { |
||
| 1119 | |||
| 1120 | private function newMembershipApplicationTokenFetcher(): MembershipApplicationTokenFetcher { |
||
| 1125 | |||
| 1126 | private function newDonationPolicyValidator(): AddDonationPolicyValidator { |
||
| 1132 | |||
| 1133 | private function newDonationAmountPolicyValidator(): AmountPolicyValidator { |
||
| 1137 | |||
| 1138 | public function getDonationTimeframeLimit() { |
||
| 1141 | |||
| 1142 | public function newSystemMessageResponse( string $message ) { |
||
| 1146 | |||
| 1147 | public function getMembershipApplicationTimeframeLimit() { |
||
| 1150 | |||
| 1151 | private function newAddCommentValidator(): AddCommentValidator { |
||
| 1154 | |||
| 1155 | private function getPageCache(): Cache { |
||
| 1158 | |||
| 1159 | public function enablePageCache() { |
||
| 1164 | |||
| 1165 | private function addProfilingDecorator( $objectToDecorate, string $profilingLabel ) { |
||
| 1174 | |||
| 1175 | public function setProfiler( Stopwatch $profiler ) { |
||
| 1178 | |||
| 1179 | public function setLogger( LoggerInterface $logger ) { |
||
| 1180 | $this->pimple['logger'] = $logger; |
||
| 1181 | } |
||
| 1182 | |||
| 1183 | } |
||
| 1184 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.