Skip to content

Commit 9faf66c

Browse files
committed
Install Phan, fix typos and docblocks.
commit a5c687525179b12bf75533a2936c3ee297cfa88d Author: Kunal Varma <[email protected]> Date: Sat Mar 11 13:35:18 2017 +0530 Phan composer script commit 403d93bc86b57e77feef500d6b88cf1514425449 Author: Kunal Varma <[email protected]> Date: Sat Mar 11 13:33:45 2017 +0530 Phan Strong analysis config commit 3ba8653f2ea1cad25ffccc3961071d2589e9c08b Author: Kunal Varma <[email protected]> Date: Sat Mar 11 13:18:39 2017 +0530 Ignore IDE settings commit 149ac44fa2c98b859e02f10b46f7eb211ee9a473 Author: Kunal Varma <[email protected]> Date: Sat Mar 11 13:17:49 2017 +0530 Phan Configuration commit cc0b15cbeee159010a8a63cfb755990ed9313669 Author: Kunal Varma <[email protected]> Date: Sat Mar 11 13:17:30 2017 +0530 Fix typos and docblock commit c4f0c025cd24678fa65bf951c11d04b8d1beea54 Author: Kunal Varma <[email protected]> Date: Sat Mar 11 11:38:45 2017 +0530 Install phan
1 parent c818f76 commit 9faf66c

17 files changed

+260
-116
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
index.php
22
.phpintel/
33
/vendor/
4-
composer.lock
4+
composer.lock
5+
/.idea

.phan/config.php

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
3+
/**
4+
* This configuration will be read and overlaid on top of the
5+
* default configuration. Command line arguments will be applied
6+
* after this file is read.
7+
*/
8+
use Phan\Issue;
9+
10+
return [
11+
12+
// If true, missing properties will be created when
13+
// they are first seen. If false, we'll report an
14+
// error message.
15+
"allow_missing_properties" => false,
16+
// Allow null to be cast as any type and for any
17+
// type to be cast to null.
18+
"null_casts_as_any_type" => false,
19+
// If enabled, scalars (int, float, bool, string, null)
20+
// are treated as if they can cast to each other.
21+
'scalar_implicit_cast' => false,
22+
// If true, seemingly undeclared variables in the global
23+
// scope will be ignored. This is useful for projects
24+
// with complicated cross-file globals that you have no
25+
// hope of fixing.
26+
'ignore_undeclared_variables_in_global_scope' => false,
27+
// Backwards Compatibility Checking
28+
'backward_compatibility_checks' => false,
29+
// If enabled, check all methods that override a
30+
// parent method to make sure its signature is
31+
// compatible with the parent's. This check
32+
// can add quite a bit of time to the analysis.
33+
'analyze_signature_compatibility' => true,
34+
// Set to true in order to attempt to detect dead
35+
// (unreferenced) code. Keep in mind that the
36+
// results will only be a guess given that classes,
37+
// properties, constants and methods can be referenced
38+
// as variables (like `$class->$property` or
39+
// `$class->$method()`) in ways that we're unable
40+
// to make sense of.
41+
'dead_code_detection' => false,
42+
// Run a quick version of checks that takes less
43+
// time
44+
"quick_mode" => false,
45+
// Enable or disable support for generic templated
46+
// class types.
47+
'generic_types_enabled' => true,
48+
// By default, Phan will not analyze all node types
49+
// in order to save time. If this config is set to true,
50+
// Phan will dig deeper into the AST tree and do an
51+
// analysis on all nodes, possibly finding more issues.
52+
//
53+
// See \Phan\Analysis::shouldVisit for the set of skipped
54+
// nodes.
55+
'should_visit_all_nodes' => true,
56+
// Override if runkit.superglobal ini directive is used.
57+
// See Phan\Config.
58+
'runkit_superglobals' => [],
59+
// Override to hardcode existence and types of (non-builtin) globals.
60+
// Class names must be prefixed with '\\'.
61+
'globals_type_map' => [],
62+
// The minimum severity level to report on. This can be
63+
// set to Issue::SEVERITY_LOW, Issue::SEVERITY_NORMAL or
64+
// Issue::SEVERITY_CRITICAL.
65+
'minimum_severity' => Issue::SEVERITY_LOW,
66+
67+
// A list of directories that should be parsed for class and
68+
// method information. After excluding the directories
69+
// defined in exclude_analysis_directory_list, the remaining
70+
// files will be statically analyzed for errors.
71+
//
72+
// Thus, both first-party and third-party code being used by
73+
// your application should be included in this list.
74+
'directory_list' => [
75+
'src',
76+
'vendor'
77+
],
78+
79+
// A directory list that defines files that will be excluded
80+
// from static analysis, but whose class and method
81+
// information should be included.
82+
//
83+
// Generally, you'll want to include the directories for
84+
// third-party code (such as "vendor/") in this list.
85+
//
86+
// n.b.: If you'd like to parse but not analyze 3rd
87+
// party code, directories containing that code
88+
// should be added to both the `directory_list`
89+
// and `exclude_analysis_directory_list` arrays.
90+
"exclude_analysis_directory_list" => [
91+
'vendor/'
92+
],
93+
];

composer.json

+7
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@
1717
"psr-4": {
1818
"Kunnu\\Dropbox\\": "src/Dropbox"
1919
}
20+
},
21+
"require-dev": {
22+
"etsy/phan": "^0.8.3"
23+
},
24+
"scripts": {
25+
"phan": "phan",
26+
"phanToFile": "phan -o phan.txt"
2027
}
2128
}

src/Dropbox/Authentication/OAuth2Client.php

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ class OAuth2Client
3737
*/
3838
protected $client;
3939

40+
/**
41+
* Random String Generator
42+
*
43+
* @var \Kunnu\Dropbox\Security\RandomStringGeneratorInterface
44+
*/
45+
protected $randStrGenerator;
46+
4047
/**
4148
* Create a new DropboxApp instance
4249
*

0 commit comments

Comments
 (0)