1 | <?php |
||
13 | class LaravelSocialiteService |
||
14 | { |
||
15 | /** |
||
16 | * OAuth app. |
||
17 | * |
||
18 | * @var |
||
19 | */ |
||
20 | protected $oauthApp; |
||
21 | |||
22 | /** |
||
23 | * Social network name. |
||
24 | * |
||
25 | * @var |
||
26 | */ |
||
27 | protected $socialNetwork; |
||
28 | |||
29 | /** |
||
30 | * Compiler for stub file. |
||
31 | * |
||
32 | * @var StubFileCompiler |
||
33 | */ |
||
34 | protected $compiler; |
||
35 | |||
36 | /** |
||
37 | * ConfigureLaravelSocialiteService constructor. |
||
38 | * |
||
39 | * @param StubFileCompiler $compiler |
||
40 | * @param Filesystem $filesystem |
||
41 | */ |
||
42 | public function __construct(StubFileCompiler $compiler, Filesystem $filesystem) |
||
47 | |||
48 | /** |
||
49 | * Set OAuth app. |
||
50 | * |
||
51 | * @param $oauthApp |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function app($oauthApp) |
||
59 | |||
60 | /** |
||
61 | * Set social network. |
||
62 | * |
||
63 | * @param $socialNetwork |
||
64 | * @return $this |
||
65 | */ |
||
66 | public function social($socialNetwork) |
||
71 | |||
72 | /** |
||
73 | * Configure Laravel Socialite Service. |
||
74 | */ |
||
75 | public function handle() |
||
80 | |||
81 | /** |
||
82 | * Add Laravel Socialite service to config/services.php file. |
||
83 | */ |
||
84 | protected function addLaravelSocialiteService() |
||
88 | |||
89 | /** |
||
90 | * Add environment variables to .env file. |
||
91 | */ |
||
92 | protected function addEnvironmentVariables() |
||
100 | |||
101 | /** |
||
102 | * Get environment file. |
||
103 | * |
||
104 | * @return mixed |
||
105 | */ |
||
106 | protected function getEnvironmentFile() |
||
117 | |||
118 | /** |
||
119 | * Get socialite services stub file. |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | private function getSocialiteServiceStubFile() |
||
127 | |||
128 | /** |
||
129 | * Get socialite environment stub file. |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | private function getSocialiteEnvironmentStubFile() |
||
137 | } |
||
138 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: