Rewrites/type-hints App and array #600

Closed
Quix0r wants to merge 29 commits from rewrites/type-hints-app into develop

29 commits

Author SHA1 Message Date
Roland Häder 4a89e1676d No null here:
@Hypolite
This is caused in include/conversation.php line 724. I don't know why there is
a wrong Addon::callHooks call here, but we should fix it over there instead of
suppressing the error message in the addon when adding a correct type hint.

It's good actually, type hints are allowing another level of debug.

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:19 +02:00
Roland Häder 1e1bba12da Opps, no DBM::is_result() here ...
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:16 +02:00
Roland Häder 02d2abd2c0 Next wrong strlen() usage replace with proper empty()
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:16 +02:00
Roland Häder e553995fc7 New-line for joy before curly brace! PR
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:16 +02:00
Roland Häder 4b6852de4b Fixed:
- no need for $ === FALSE here, according to reviewer

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:16 +02:00
Roland Häder 932d51580b Continued:
- added/removed empty line(s)
- curly braces after function/method definition should be in new line (PR/PSR-2)
- proper todo

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:15 +02:00
Roland Häder 5260c920c5 Continued:
- added new-line before curly brace in function/method definition - PR/PSR-2
- added some spaces
- added TODOs for next wave

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:15 +02:00
Roland Häder f167730b16 Nope, not wanted here:
MrPetovan@github:
| No, this is fetching all the users who set StatusNet mirroring. it starts
| from a pconfig value to get user IDs, which is the opposite of PConfig::get()

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:15 +02:00
Roland Häder f9a5efbfbe Continued:
- after function/method declaration, make a new line for curly brace - PR/PSR-2

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:15 +02:00
Roland Häder cbd18c5d99 Continued:
- used empty() instead of isset() - PR
- @TODO must be with 3 slashes if not in comment block for some IDEs being used
- added some empty lines

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:15 +02:00
Roland Häder 2ab82ad084 Continued:
- used empty() instead of strlen() - PR
- added empty lines, removed some

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:57:15 +02:00
Roland Häder bfe2f6e891
Fixed E_NOTICE of missing 'output' array field.
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:55:40 +02:00
Roland Häder a44c89be7c
Fixed:
- Fatal error: Uncaught TypeError: Argument 2 passed to blockem_display_item()
  must be of the type array, null given, called in /var/www/../htdocs/src/Core/Addon.php
  on line 246 and defined in /var/www/../htdocs/addon/blockem/blockem.php on
  line 142

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:55:40 +02:00
Roland Häder f1f72b780a
Removed braces ...
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:55:39 +02:00
Roland Häder 50d82f4004
Continued:
- removed optional "null", was not in original code
- added spaces into SQL query
- added space
- added back & (call-by-reference)
- removed no longer used parameter
- added type-hint App

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:55:39 +02:00
Roland Häder ac46a91a2c
Fixed parser errors
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:55:12 +02:00
Roland Häder 49422583cc
Fixed error:
PHP Fatal error:  Uncaught TypeError: Argument 2 passed to statusnet_cron() must
be of the type array, null given, called in /var/www/../src/Core/Addon.php on
line 246 and defined in /var/www/../addon/statusnet/statusnet.php:727

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:57 +02:00
Roland Häder 4da670936d
Removed no longer needed if() block.
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:34 +02:00
Roland Häder 249a8ac6fc
Continued:
- SQL keywords must be all-uppercase (MrPetovan)
- used empty(), not isset() (annando)
- used more DBM::is_result()

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:34 +02:00
Roland Häder ed59c29484
Added more type-hints and imported App.
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:34 +02:00
Roland Häder 3a9a5fcde8
Continued:
- x() is deprecated, use proper isset()/empty() (MrPetovan)

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:34 +02:00
Roland Häder d05a92370a
Continued:
- changed NULL -> null (was used at more places)
- converted CRLF -> LF

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:34 +02:00
Roland Häder eaa307be58
Added missing "use Friendica\Database\DBM;" line
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:33 +02:00
Roland Häder ffeb70a031
Allow NULL here, fixing error
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:33 +02:00
Roland Häder 0e0ce23af5
Ops, to much array ...
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:54:33 +02:00
Roland Häder f9ab3741e6
Fixed "import" line (ops)
Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:53:57 +02:00
Roland Häder 39421cf1a4
Continued:
- added array as type-hint
- don't forget & (call-by-reference) here as $b is maybe being modified in the
  function

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:53:57 +02:00
Roland Häder 6c3a37efda
Continued:
- even more App and array as type-hints added (cleaner code)

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:53:57 +02:00
Roland Häder 5f02272cf9
Continued:
- added App (and imported it) as type-hint for $a
- also avoided & here as $a should not be modified within the function
- $b is 99.999% an array, let's add type-hint here

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-07-20 22:53:56 +02:00