Correction of many errors code inspection.

Adjustments code according to the standards.
Adding missing PHPDoc comment.