| 1 | <?php |
||
| 11 | class WebScrapingController extends Controller |
||
| 12 | { |
||
| 13 | protected $crawler; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * [__construct description] |
||
| 17 | */ |
||
| 18 | public function __construct() |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Return all data to the Stripe API dashboard |
||
| 25 | * @return mixed |
||
| 26 | */ |
||
| 27 | public function getPage() |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Scrape the Links |
||
| 36 | * @param $siteToCrawl |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | public function getData($siteToCrawl) |
||
| 53 | } |
||
| 54 |
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: