suncat2000 / MobileDetectBundle

Symfony 2/3/4 bundle for detect mobile devices, manage mobile view and redirect to the mobile and tablet version.
397 stars 154 forks source link

Added more consistency to the code #17

Closed Ninir closed 11 years ago

Ninir commented 11 years ago
Ninir commented 11 years ago

@suncat2000 In the DeviceView class, why not using strict comparison for is*View functions? For instance: line 76

suncat2000 commented 11 years ago

I'm sorry I did not quite understand what you mean You can write an example?

Ninir commented 11 years ago

Well, for instance line 76 (following the link I gave above), you can see this:

return ($this->viewType == self::VIEW_FULL);

Why not using this (3 equals, comparing the type of vars):

return $this->viewType === self::VIEW_FULL;
suncat2000 commented 11 years ago

I do not know why I was so wrote))) Yes you are right, better use strict compare in this expression