Skip to content

Commit

Permalink
Use constant in switch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 23, 2019
1 parent 8ae5c3b commit 0b30e4a
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 107 deletions.
2 changes: 1 addition & 1 deletion bin/amphtml-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def GenerateErrorFormatsPHP(out, error_formats):
switch ( $code ) {''')

for ( code, message_format ) in error_formats.items():
out.append('\t\t\tcase \'%s\':' % code)
out.append('\t\t\tcase self::%s:' % code)
message_format = re.sub( r'%(\d+)', r'%\1$s', message_format )
out.append('\t\t\t\treturn __( %s, \'amp\' );' % Phpize( message_format ))

Expand Down
Loading

0 comments on commit 0b30e4a

Please sign in to comment.