MITLibraries / MITLibraries-child

A Wordpress child theme that descends from MITLibraries-parent
GNU General Public License v3.0
1 stars 1 forks source link

Adds another closing parenthesis; fixes #63 #64

Closed matt-bernhardt closed 8 years ago

matt-bernhardt commented 8 years ago

Tagging @frrrances for code review.

This solves a somewhat thorny problem in inc/postHead.php, which had two syntax errors on line 8.

The first was mis-matched parentheses, and was relatively easy to resolve.

The second was that the empty() function cannot be called on the results of a function, but only on a pre-defined variable. So, this PR first calls get_bloginfo() and stores the result in a temporary variable, and then applies empty() on that.

The message from the syntax checker, for the record, was:

PHP Fatal error:  Can't use function return value in write context in ./inc/postHead.php on line 8
Fatal error: Can't use function return value in write context in ./inc/postHead.php on line 8
Errors parsing ./inc/postHead.php

Looking at the documentation for empty() at http://php.net/manual/en/function.empty.php there's a note:

*Note:* Because this is a language construct and not a function, it cannot be called using variable functions.
frrrances commented 8 years ago

excellent! and 10 codeclimate fixes! 👍