content_type
stringclasses
8 values
main_lang
stringclasses
7 values
message
stringlengths
1
50
sha
stringlengths
40
40
patch
stringlengths
52
962k
file_count
int64
1
300
Text
Text
add link to the paper and the tratz dataset
ad7755c81fa5bf9f9731e6cd7196f10cc30b38b8
<ide><path>research/lexnet_nc/README.md <ide> Training a model requires the following: <ide> 1. A collection of noun compounds that have been labeled using a *relation <ide> inventory*. The inventory describes the specific relationships that you'd <ide> like the model to differentiate (e.g. *part of* versus *composed of* versus <del> *purpose*), and generally may consist of tens of classes. <add> *purpose*), and generally may consist of tens of classes. <add> You can download the dataset used in the paper from [here](https://vered1986.github.io/papers/Tratz2011_Dataset.tar.gz). <ide> 2. You'll need a collection of word embeddings: the path-based model uses the <ide> word embeddings as part of the path representation, and the distributional <ide> models use the word embeddings directly as prediction features. <ide> train, dev, and test sets, and will include a confusion matrix for each. <ide> <ide> If you have any questions, issues, or suggestions, feel free to contact either <ide> @vered1986 or @waterson. <add> <add>If you use this code for any published research, please include the following citation: <add> <add>Olive Oil Is Made of Olives, Baby Oil Is Made for Babies: Interpreting Noun Compounds Using Paraphrases in a Neural Model. <add>Vered Shwartz and Chris Waterson. NAACL 2018. [link](https://arxiv.org/pdf/1803.08073.pdf).
1
Javascript
Javascript
organize tokenizedbuffer test
4c2680e68a9d9ed1234b192bc3cdcdd7d8878132
<ide><path>spec/tokenized-buffer-spec.js <ide> describe('TokenizedBuffer', () => { <ide> }) <ide> }) <ide> <del> describe('when the buffer is destroyed', () => { <del> beforeEach(() => { <del> buffer = atom.project.bufferForPathSync('sample.js') <del> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.grammarForScopeName('source.js'), tabLength: 2}) <del> startTokenizing(tokenizedBuffer) <del> }) <add> describe('tokenizing', () => { <add> describe('when the buffer is destroyed', () => { <add> beforeEach(() => { <add> buffer = atom.project.bufferForPathSync('sample.js') <add> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.grammarForScopeName('source.js'), tabLength: 2}) <add> startTokenizing(tokenizedBuffer) <add> }) <ide> <del> it('stops tokenization', () => { <del> tokenizedBuffer.destroy() <del> spyOn(tokenizedBuffer, 'tokenizeNextChunk') <del> advanceClock() <del> expect(tokenizedBuffer.tokenizeNextChunk).not.toHaveBeenCalled() <add> it('stops tokenization', () => { <add> tokenizedBuffer.destroy() <add> spyOn(tokenizedBuffer, 'tokenizeNextChunk') <add> advanceClock() <add> expect(tokenizedBuffer.tokenizeNextChunk).not.toHaveBeenCalled() <add> }) <ide> }) <del> }) <ide> <del> describe('when the buffer contains soft-tabs', () => { <del> beforeEach(() => { <del> buffer = atom.project.bufferForPathSync('sample.js') <del> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.grammarForScopeName('source.js'), tabLength: 2}) <del> startTokenizing(tokenizedBuffer) <del> }) <add> describe('when the buffer contains soft-tabs', () => { <add> beforeEach(() => { <add> buffer = atom.project.bufferForPathSync('sample.js') <add> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.grammarForScopeName('source.js'), tabLength: 2}) <add> startTokenizing(tokenizedBuffer) <add> }) <ide> <del> afterEach(() => { <del> tokenizedBuffer.destroy() <del> buffer.release() <del> }) <add> afterEach(() => { <add> tokenizedBuffer.destroy() <add> buffer.release() <add> }) <ide> <del> describe('on construction', () => <del> it('tokenizes lines chunk at a time in the background', () => { <del> const line0 = tokenizedBuffer.tokenizedLines[0] <del> expect(line0).toBeUndefined() <add> describe('on construction', () => <add> it('tokenizes lines chunk at a time in the background', () => { <add> const line0 = tokenizedBuffer.tokenizedLines[0] <add> expect(line0).toBeUndefined() <ide> <del> const line11 = tokenizedBuffer.tokenizedLines[11] <del> expect(line11).toBeUndefined() <add> const line11 = tokenizedBuffer.tokenizedLines[11] <add> expect(line11).toBeUndefined() <ide> <del> // tokenize chunk 1 <del> advanceClock() <del> expect(tokenizedBuffer.tokenizedLines[0].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[4].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[5]).toBeUndefined() <add> // tokenize chunk 1 <add> advanceClock() <add> expect(tokenizedBuffer.tokenizedLines[0].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[4].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[5]).toBeUndefined() <ide> <del> // tokenize chunk 2 <del> advanceClock() <del> expect(tokenizedBuffer.tokenizedLines[5].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[9].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[10]).toBeUndefined() <add> // tokenize chunk 2 <add> advanceClock() <add> expect(tokenizedBuffer.tokenizedLines[5].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[9].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[10]).toBeUndefined() <ide> <del> // tokenize last chunk <del> advanceClock() <del> expect(tokenizedBuffer.tokenizedLines[10].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[12].ruleStack != null).toBeTruthy() <del> }) <del> ) <add> // tokenize last chunk <add> advanceClock() <add> expect(tokenizedBuffer.tokenizedLines[10].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[12].ruleStack != null).toBeTruthy() <add> }) <add> ) <ide> <del> describe('when the buffer is partially tokenized', () => { <del> beforeEach(() => { <del> // tokenize chunk 1 only <del> advanceClock() <del> }) <add> describe('when the buffer is partially tokenized', () => { <add> beforeEach(() => { <add> // tokenize chunk 1 only <add> advanceClock() <add> }) <ide> <del> describe('when there is a buffer change inside the tokenized region', () => { <del> describe('when lines are added', () => { <del> it('pushes the invalid rows down', () => { <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <del> buffer.insert([1, 0], '\n\n') <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(7) <add> describe('when there is a buffer change inside the tokenized region', () => { <add> describe('when lines are added', () => { <add> it('pushes the invalid rows down', () => { <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <add> buffer.insert([1, 0], '\n\n') <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(7) <add> }) <ide> }) <del> }) <ide> <del> describe('when lines are removed', () => { <del> it('pulls the invalid rows up', () => { <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <del> buffer.delete([[1, 0], [3, 0]]) <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(2) <add> describe('when lines are removed', () => { <add> it('pulls the invalid rows up', () => { <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <add> buffer.delete([[1, 0], [3, 0]]) <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(2) <add> }) <add> }) <add> <add> describe('when the change invalidates all the lines before the current invalid region', () => { <add> it('retokenizes the invalidated lines and continues into the valid region', () => { <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <add> buffer.insert([2, 0], '/*') <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(3) <add> advanceClock() <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(8) <add> }) <ide> }) <ide> }) <ide> <del> describe('when the change invalidates all the lines before the current invalid region', () => { <del> it('retokenizes the invalidated lines and continues into the valid region', () => { <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <del> buffer.insert([2, 0], '/*') <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(3) <del> advanceClock() <add> describe('when there is a buffer change surrounding an invalid row', () => { <add> it('pushes the invalid row to the end of the change', () => { <add> buffer.setTextInRange([[4, 0], [6, 0]], '\n\n\n') <ide> expect(tokenizedBuffer.firstInvalidRow()).toBe(8) <ide> }) <ide> }) <del> }) <ide> <del> describe('when there is a buffer change surrounding an invalid row', () => { <del> it('pushes the invalid row to the end of the change', () => { <del> buffer.setTextInRange([[4, 0], [6, 0]], '\n\n\n') <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(8) <add> describe('when there is a buffer change inside an invalid region', () => { <add> it('does not attempt to tokenize the lines in the change, and preserves the existing invalid row', () => { <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <add> buffer.setTextInRange([[6, 0], [7, 0]], '\n\n\n') <add> expect(tokenizedBuffer.tokenizedLines[6]).toBeUndefined() <add> expect(tokenizedBuffer.tokenizedLines[7]).toBeUndefined() <add> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <add> }) <ide> }) <ide> }) <ide> <del> describe('when there is a buffer change inside an invalid region', () => { <del> it('does not attempt to tokenize the lines in the change, and preserves the existing invalid row', () => { <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <del> buffer.setTextInRange([[6, 0], [7, 0]], '\n\n\n') <del> expect(tokenizedBuffer.tokenizedLines[6]).toBeUndefined() <del> expect(tokenizedBuffer.tokenizedLines[7]).toBeUndefined() <del> expect(tokenizedBuffer.firstInvalidRow()).toBe(5) <del> }) <del> }) <del> }) <add> describe('when the buffer is fully tokenized', () => { <add> beforeEach(() => fullyTokenize(tokenizedBuffer)) <add> <add> describe('when there is a buffer change that is smaller than the chunk size', () => { <add> describe('when lines are updated, but none are added or removed', () => { <add> it('updates tokens to reflect the change', () => { <add> buffer.setTextInRange([[0, 0], [2, 0]], 'foo()\n7\n') <add> <add> expect(tokenizedBuffer.tokenizedLines[0].tokens[1]).toEqual({value: '(', scopes: ['source.js', 'meta.function-call.js', 'meta.arguments.js', 'punctuation.definition.arguments.begin.bracket.round.js']}) <add> expect(tokenizedBuffer.tokenizedLines[1].tokens[0]).toEqual({value: '7', scopes: ['source.js', 'constant.numeric.decimal.js']}) <add> // line 2 is unchanged <add> expect(tokenizedBuffer.tokenizedLines[2].tokens[1]).toEqual({value: 'if', scopes: ['source.js', 'keyword.control.js']}) <add> }) <add> <add> describe('when the change invalidates the tokenization of subsequent lines', () => { <add> it('schedules the invalidated lines to be tokenized in the background', () => { <add> buffer.insert([5, 30], '/* */') <add> buffer.insert([2, 0], '/*') <add> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js']) <add> <add> advanceClock() <add> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[4].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[5].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> }) <add> }) <add> <add> it('resumes highlighting with the state of the previous line', () => { <add> buffer.insert([0, 0], '/*') <add> buffer.insert([5, 0], '*/') <add> <add> buffer.insert([1, 0], 'var ') <add> expect(tokenizedBuffer.tokenizedLines[1].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> }) <add> }) <add> <add> describe('when lines are both updated and removed', () => { <add> it('updates tokens to reflect the change', () => { <add> buffer.setTextInRange([[1, 0], [3, 0]], 'foo()') <ide> <del> describe('when the buffer is fully tokenized', () => { <del> beforeEach(() => fullyTokenize(tokenizedBuffer)) <add> // previous line 0 remains <add> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({value: 'var', scopes: ['source.js', 'storage.type.var.js']}) <ide> <del> describe('when there is a buffer change that is smaller than the chunk size', () => { <del> describe('when lines are updated, but none are added or removed', () => { <del> it('updates tokens to reflect the change', () => { <del> buffer.setTextInRange([[0, 0], [2, 0]], 'foo()\n7\n') <add> // previous line 3 should be combined with input to form line 1 <add> expect(tokenizedBuffer.tokenizedLines[1].tokens[0]).toEqual({value: 'foo', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <add> expect(tokenizedBuffer.tokenizedLines[1].tokens[6]).toEqual({value: '=', scopes: ['source.js', 'keyword.operator.assignment.js']}) <ide> <del> expect(tokenizedBuffer.tokenizedLines[0].tokens[1]).toEqual({value: '(', scopes: ['source.js', 'meta.function-call.js', 'meta.arguments.js', 'punctuation.definition.arguments.begin.bracket.round.js']}) <del> expect(tokenizedBuffer.tokenizedLines[1].tokens[0]).toEqual({value: '7', scopes: ['source.js', 'constant.numeric.decimal.js']}) <del> // line 2 is unchanged <del> expect(tokenizedBuffer.tokenizedLines[2].tokens[1]).toEqual({value: 'if', scopes: ['source.js', 'keyword.control.js']}) <add> // lines below deleted regions should be shifted upward <add> expect(tokenizedBuffer.tokenizedLines[2].tokens[1]).toEqual({value: 'while', scopes: ['source.js', 'keyword.control.js']}) <add> expect(tokenizedBuffer.tokenizedLines[3].tokens[1]).toEqual({value: '=', scopes: ['source.js', 'keyword.operator.assignment.js']}) <add> expect(tokenizedBuffer.tokenizedLines[4].tokens[1]).toEqual({value: '<', scopes: ['source.js', 'keyword.operator.comparison.js']}) <add> }) <ide> }) <ide> <ide> describe('when the change invalidates the tokenization of subsequent lines', () => { <ide> it('schedules the invalidated lines to be tokenized in the background', () => { <ide> buffer.insert([5, 30], '/* */') <del> buffer.insert([2, 0], '/*') <add> buffer.setTextInRange([[2, 0], [3, 0]], '/*') <add> expect(tokenizedBuffer.tokenizedLines[2].tokens[0].scopes).toEqual(['source.js', 'comment.block.js', 'punctuation.definition.comment.begin.js']) <ide> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js']) <ide> <ide> advanceClock() <ide> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <ide> expect(tokenizedBuffer.tokenizedLines[4].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[5].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <ide> }) <ide> }) <ide> <del> it('resumes highlighting with the state of the previous line', () => { <del> buffer.insert([0, 0], '/*') <del> buffer.insert([5, 0], '*/') <add> describe('when lines are both updated and inserted', () => { <add> it('updates tokens to reflect the change', () => { <add> buffer.setTextInRange([[1, 0], [2, 0]], 'foo()\nbar()\nbaz()\nquux()') <ide> <del> buffer.insert([1, 0], 'var ') <del> expect(tokenizedBuffer.tokenizedLines[1].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> }) <del> }) <del> <del> describe('when lines are both updated and removed', () => { <del> it('updates tokens to reflect the change', () => { <del> buffer.setTextInRange([[1, 0], [3, 0]], 'foo()') <add> // previous line 0 remains <add> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({ value: 'var', scopes: ['source.js', 'storage.type.var.js']}) <ide> <del> // previous line 0 remains <del> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({value: 'var', scopes: ['source.js', 'storage.type.var.js']}) <add> // 3 new lines inserted <add> expect(tokenizedBuffer.tokenizedLines[1].tokens[0]).toEqual({value: 'foo', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <add> expect(tokenizedBuffer.tokenizedLines[2].tokens[0]).toEqual({value: 'bar', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <add> expect(tokenizedBuffer.tokenizedLines[3].tokens[0]).toEqual({value: 'baz', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <ide> <del> // previous line 3 should be combined with input to form line 1 <del> expect(tokenizedBuffer.tokenizedLines[1].tokens[0]).toEqual({value: 'foo', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <del> expect(tokenizedBuffer.tokenizedLines[1].tokens[6]).toEqual({value: '=', scopes: ['source.js', 'keyword.operator.assignment.js']}) <add> // previous line 2 is joined with quux() on line 4 <add> expect(tokenizedBuffer.tokenizedLines[4].tokens[0]).toEqual({value: 'quux', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <add> expect(tokenizedBuffer.tokenizedLines[4].tokens[4]).toEqual({value: 'if', scopes: ['source.js', 'keyword.control.js']}) <ide> <del> // lines below deleted regions should be shifted upward <del> expect(tokenizedBuffer.tokenizedLines[2].tokens[1]).toEqual({value: 'while', scopes: ['source.js', 'keyword.control.js']}) <del> expect(tokenizedBuffer.tokenizedLines[3].tokens[1]).toEqual({value: '=', scopes: ['source.js', 'keyword.operator.assignment.js']}) <del> expect(tokenizedBuffer.tokenizedLines[4].tokens[1]).toEqual({value: '<', scopes: ['source.js', 'keyword.operator.comparison.js']}) <add> // previous line 3 is pushed down to become line 5 <add> expect(tokenizedBuffer.tokenizedLines[5].tokens[3]).toEqual({value: '=', scopes: ['source.js', 'keyword.operator.assignment.js']}) <add> }) <ide> }) <del> }) <ide> <del> describe('when the change invalidates the tokenization of subsequent lines', () => { <del> it('schedules the invalidated lines to be tokenized in the background', () => { <del> buffer.insert([5, 30], '/* */') <del> buffer.setTextInRange([[2, 0], [3, 0]], '/*') <del> expect(tokenizedBuffer.tokenizedLines[2].tokens[0].scopes).toEqual(['source.js', 'comment.block.js', 'punctuation.definition.comment.begin.js']) <del> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js']) <add> describe('when the change invalidates the tokenization of subsequent lines', () => { <add> it('schedules the invalidated lines to be tokenized in the background', () => { <add> buffer.insert([5, 30], '/* */') <add> buffer.insert([2, 0], '/*\nabcde\nabcder') <add> expect(tokenizedBuffer.tokenizedLines[2].tokens[0].scopes).toEqual(['source.js', 'comment.block.js', 'punctuation.definition.comment.begin.js']) <add> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[4].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[5].tokens[0].scopes).toEqual(['source.js']) <ide> <del> advanceClock() <del> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[4].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> advanceClock() // tokenize invalidated lines in background <add> expect(tokenizedBuffer.tokenizedLines[5].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[6].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[7].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <add> expect(tokenizedBuffer.tokenizedLines[8].tokens[0].scopes).not.toBe(['source.js', 'comment.block.js']) <add> }) <ide> }) <ide> }) <ide> <del> describe('when lines are both updated and inserted', () => { <del> it('updates tokens to reflect the change', () => { <del> buffer.setTextInRange([[1, 0], [2, 0]], 'foo()\nbar()\nbaz()\nquux()') <add> describe('when there is an insertion that is larger than the chunk size', () => <add> it('tokenizes the initial chunk synchronously, then tokenizes the remaining lines in the background', () => { <add> const commentBlock = _.multiplyString('// a comment\n', tokenizedBuffer.chunkSize + 2) <add> buffer.insert([0, 0], commentBlock) <add> expect(tokenizedBuffer.tokenizedLines[0].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[4].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[5]).toBeUndefined() <ide> <del> // previous line 0 remains <del> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({ value: 'var', scopes: ['source.js', 'storage.type.var.js']}) <add> advanceClock() <add> expect(tokenizedBuffer.tokenizedLines[5].ruleStack != null).toBeTruthy() <add> expect(tokenizedBuffer.tokenizedLines[6].ruleStack != null).toBeTruthy() <add> }) <add> ) <ide> <del> // 3 new lines inserted <del> expect(tokenizedBuffer.tokenizedLines[1].tokens[0]).toEqual({value: 'foo', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <del> expect(tokenizedBuffer.tokenizedLines[2].tokens[0]).toEqual({value: 'bar', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <del> expect(tokenizedBuffer.tokenizedLines[3].tokens[0]).toEqual({value: 'baz', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <add> it('does not break out soft tabs across a scope boundary', async () => { <add> await atom.packages.activatePackage('language-gfm') <ide> <del> // previous line 2 is joined with quux() on line 4 <del> expect(tokenizedBuffer.tokenizedLines[4].tokens[0]).toEqual({value: 'quux', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js']}) <del> expect(tokenizedBuffer.tokenizedLines[4].tokens[4]).toEqual({value: 'if', scopes: ['source.js', 'keyword.control.js']}) <add> tokenizedBuffer.setTabLength(4) <add> tokenizedBuffer.setGrammar(atom.grammars.selectGrammar('.md')) <add> buffer.setText(' <![]()\n ') <add> fullyTokenize(tokenizedBuffer) <ide> <del> // previous line 3 is pushed down to become line 5 <del> expect(tokenizedBuffer.tokenizedLines[5].tokens[3]).toEqual({value: '=', scopes: ['source.js', 'keyword.operator.assignment.js']}) <del> }) <del> }) <add> let length = 0 <add> for (let tag of tokenizedBuffer.tokenizedLines[1].tags) { <add> if (tag > 0) length += tag <add> } <ide> <del> describe('when the change invalidates the tokenization of subsequent lines', () => { <del> it('schedules the invalidated lines to be tokenized in the background', () => { <del> buffer.insert([5, 30], '/* */') <del> buffer.insert([2, 0], '/*\nabcde\nabcder') <del> expect(tokenizedBuffer.tokenizedLines[2].tokens[0].scopes).toEqual(['source.js', 'comment.block.js', 'punctuation.definition.comment.begin.js']) <del> expect(tokenizedBuffer.tokenizedLines[3].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[4].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[5].tokens[0].scopes).toEqual(['source.js']) <del> <del> advanceClock() // tokenize invalidated lines in background <del> expect(tokenizedBuffer.tokenizedLines[5].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[6].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[7].tokens[0].scopes).toEqual(['source.js', 'comment.block.js']) <del> expect(tokenizedBuffer.tokenizedLines[8].tokens[0].scopes).not.toBe(['source.js', 'comment.block.js']) <del> }) <add> expect(length).toBe(4) <ide> }) <ide> }) <add> }) <ide> <del> describe('when there is an insertion that is larger than the chunk size', () => <del> it('tokenizes the initial chunk synchronously, then tokenizes the remaining lines in the background', () => { <del> const commentBlock = _.multiplyString('// a comment\n', tokenizedBuffer.chunkSize + 2) <del> buffer.insert([0, 0], commentBlock) <del> expect(tokenizedBuffer.tokenizedLines[0].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[4].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[5]).toBeUndefined() <del> <del> advanceClock() <del> expect(tokenizedBuffer.tokenizedLines[5].ruleStack != null).toBeTruthy() <del> expect(tokenizedBuffer.tokenizedLines[6].ruleStack != null).toBeTruthy() <del> }) <del> ) <del> <del> it('does not break out soft tabs across a scope boundary', async () => { <del> await atom.packages.activatePackage('language-gfm') <add> describe('when the buffer contains hard-tabs', () => { <add> beforeEach(async () => { <add> atom.packages.activatePackage('language-coffee-script') <ide> <del> tokenizedBuffer.setTabLength(4) <del> tokenizedBuffer.setGrammar(atom.grammars.selectGrammar('.md')) <del> buffer.setText(' <![]()\n ') <del> fullyTokenize(tokenizedBuffer) <add> buffer = atom.project.bufferForPathSync('sample-with-tabs.coffee') <add> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.grammarForScopeName('source.coffee'), tabLength: 2}) <add> startTokenizing(tokenizedBuffer) <add> }) <ide> <del> let length = 0 <del> for (let tag of tokenizedBuffer.tokenizedLines[1].tags) { <del> if (tag > 0) length += tag <del> } <add> afterEach(() => { <add> tokenizedBuffer.destroy() <add> buffer.release() <add> }) <ide> <del> expect(length).toBe(4) <add> describe('when the buffer is fully tokenized', () => { <add> beforeEach(() => fullyTokenize(tokenizedBuffer)) <ide> }) <ide> }) <del> }) <ide> <del> describe('when the buffer contains hard-tabs', () => { <del> beforeEach(async () => { <del> atom.packages.activatePackage('language-coffee-script') <add> describe('when tokenization completes', () => { <add> it('emits the `tokenized` event', async () => { <add> const editor = await atom.workspace.open('sample.js') <ide> <del> buffer = atom.project.bufferForPathSync('sample-with-tabs.coffee') <del> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.grammarForScopeName('source.coffee'), tabLength: 2}) <del> startTokenizing(tokenizedBuffer) <del> }) <add> const tokenizedHandler = jasmine.createSpy('tokenized handler') <add> editor.tokenizedBuffer.onDidTokenize(tokenizedHandler) <add> fullyTokenize(editor.tokenizedBuffer) <add> expect(tokenizedHandler.callCount).toBe(1) <add> }) <ide> <del> afterEach(() => { <del> tokenizedBuffer.destroy() <del> buffer.release() <del> }) <add> it("doesn't re-emit the `tokenized` event when it is re-tokenized", async () => { <add> const editor = await atom.workspace.open('sample.js') <add> fullyTokenize(editor.tokenizedBuffer) <ide> <del> describe('when the buffer is fully tokenized', () => { <del> beforeEach(() => fullyTokenize(tokenizedBuffer)) <add> const tokenizedHandler = jasmine.createSpy('tokenized handler') <add> editor.tokenizedBuffer.onDidTokenize(tokenizedHandler) <add> editor.getBuffer().insert([0, 0], "'") <add> fullyTokenize(editor.tokenizedBuffer) <add> expect(tokenizedHandler).not.toHaveBeenCalled() <add> }) <ide> }) <del> }) <ide> <del> describe('when the grammar is tokenized', () => { <del> it('emits the `tokenized` event', async () => { <del> const editor = await atom.workspace.open('sample.js') <add> describe('when the grammar is updated because a grammar it includes is activated', async () => { <add> it('re-emits the `tokenized` event', async () => { <add> const editor = await atom.workspace.open('coffee.coffee') <ide> <del> const tokenizedHandler = jasmine.createSpy('tokenized handler') <del> editor.tokenizedBuffer.onDidTokenize(tokenizedHandler) <del> fullyTokenize(editor.tokenizedBuffer) <del> expect(tokenizedHandler.callCount).toBe(1) <del> }) <add> const tokenizedHandler = jasmine.createSpy('tokenized handler') <add> editor.tokenizedBuffer.onDidTokenize(tokenizedHandler) <add> fullyTokenize(editor.tokenizedBuffer) <add> tokenizedHandler.reset() <ide> <del> it("doesn't re-emit the `tokenized` event when it is re-tokenized", async () => { <del> const editor = await atom.workspace.open('sample.js') <del> fullyTokenize(editor.tokenizedBuffer) <add> await atom.packages.activatePackage('language-coffee-script') <add> fullyTokenize(editor.tokenizedBuffer) <add> expect(tokenizedHandler.callCount).toBe(1) <add> }) <ide> <del> const tokenizedHandler = jasmine.createSpy('tokenized handler') <del> editor.tokenizedBuffer.onDidTokenize(tokenizedHandler) <del> editor.getBuffer().insert([0, 0], "'") <del> fullyTokenize(editor.tokenizedBuffer) <del> expect(tokenizedHandler).not.toHaveBeenCalled() <del> }) <del> }) <add> it('retokenizes the buffer', async () => { <add> await atom.packages.activatePackage('language-ruby-on-rails') <add> await atom.packages.activatePackage('language-ruby') <ide> <del> describe('when the grammar is updated because a grammar it includes is activated', async () => { <del> it('re-emits the `tokenized` event', async () => { <del> const editor = await atom.workspace.open('coffee.coffee') <add> buffer = atom.project.bufferForPathSync() <add> buffer.setText("<div class='name'><%= User.find(2).full_name %></div>") <ide> <del> const tokenizedHandler = jasmine.createSpy('tokenized handler') <del> editor.tokenizedBuffer.onDidTokenize(tokenizedHandler) <del> fullyTokenize(editor.tokenizedBuffer) <del> tokenizedHandler.reset() <add> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.selectGrammar('test.erb'), tabLength: 2}) <add> fullyTokenize(tokenizedBuffer) <add> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({ <add> value: "<div class='name'>", <add> scopes: ['text.html.ruby'] <add> }) <ide> <del> await atom.packages.activatePackage('language-coffee-script') <del> fullyTokenize(editor.tokenizedBuffer) <del> expect(tokenizedHandler.callCount).toBe(1) <add> await atom.packages.activatePackage('language-html') <add> fullyTokenize(tokenizedBuffer) <add> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({ <add> value: '<', <add> scopes: ['text.html.ruby', 'meta.tag.block.any.html', 'punctuation.definition.tag.begin.html'] <add> }) <add> }) <ide> }) <ide> <del> it('retokenizes the buffer', async () => { <del> await atom.packages.activatePackage('language-ruby-on-rails') <del> await atom.packages.activatePackage('language-ruby') <del> <del> buffer = atom.project.bufferForPathSync() <del> buffer.setText("<div class='name'><%= User.find(2).full_name %></div>") <add> describe('when the buffer is configured with the null grammar', () => { <add> it('does not actually tokenize using the grammar', () => { <add> spyOn(NullGrammar, 'tokenizeLine').andCallThrough() <add> buffer = atom.project.bufferForPathSync('sample.will-use-the-null-grammar') <add> buffer.setText('a\nb\nc') <add> tokenizedBuffer = new TokenizedBuffer({buffer, tabLength: 2}) <add> const tokenizeCallback = jasmine.createSpy('onDidTokenize') <add> tokenizedBuffer.onDidTokenize(tokenizeCallback) <add> <add> expect(tokenizedBuffer.tokenizedLines[0]).toBeUndefined() <add> expect(tokenizedBuffer.tokenizedLines[1]).toBeUndefined() <add> expect(tokenizedBuffer.tokenizedLines[2]).toBeUndefined() <add> expect(tokenizeCallback.callCount).toBe(0) <add> expect(NullGrammar.tokenizeLine).not.toHaveBeenCalled() <ide> <del> tokenizedBuffer = new TokenizedBuffer({buffer, grammar: atom.grammars.selectGrammar('test.erb'), tabLength: 2}) <del> fullyTokenize(tokenizedBuffer) <del> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({ <del> value: "<div class='name'>", <del> scopes: ['text.html.ruby'] <del> }) <del> <del> await atom.packages.activatePackage('language-html') <del> fullyTokenize(tokenizedBuffer) <del> expect(tokenizedBuffer.tokenizedLines[0].tokens[0]).toEqual({ <del> value: '<', <del> scopes: ['text.html.ruby', 'meta.tag.block.any.html', 'punctuation.definition.tag.begin.html'] <add> fullyTokenize(tokenizedBuffer) <add> expect(tokenizedBuffer.tokenizedLines[0]).toBeUndefined() <add> expect(tokenizedBuffer.tokenizedLines[1]).toBeUndefined() <add> expect(tokenizedBuffer.tokenizedLines[2]).toBeUndefined() <add> expect(tokenizeCallback.callCount).toBe(0) <add> expect(NullGrammar.tokenizeLine).not.toHaveBeenCalled() <ide> }) <ide> }) <ide> }) <ide> describe('TokenizedBuffer', () => { <ide> }) <ide> }) // } <ide> <del> describe('::isFoldableAtRow(row)', () => { <add> describe('.isFoldableAtRow(row)', () => { <ide> beforeEach(() => { <ide> buffer = atom.project.bufferForPathSync('sample.js') <ide> buffer.insert([10, 0], ' // multi-line\n // comment\n // block\n') <ide> describe('TokenizedBuffer', () => { <ide> }) <ide> }) <ide> <del> describe('::tokenizedLineForRow(row)', () => { <add> describe('.tokenizedLineForRow(row)', () => { <ide> it("returns the tokenized line for a row, or a placeholder line if it hasn't been tokenized yet", () => { <ide> buffer = atom.project.bufferForPathSync('sample.js') <ide> const grammar = atom.grammars.grammarForScopeName('source.js') <ide> describe('TokenizedBuffer', () => { <ide> }) <ide> }) <ide> <del> describe('when the buffer is configured with the null grammar', () => { <del> it('does not actually tokenize using the grammar', () => { <del> spyOn(NullGrammar, 'tokenizeLine').andCallThrough() <del> buffer = atom.project.bufferForPathSync('sample.will-use-the-null-grammar') <del> buffer.setText('a\nb\nc') <del> tokenizedBuffer = new TokenizedBuffer({buffer, tabLength: 2}) <del> const tokenizeCallback = jasmine.createSpy('onDidTokenize') <del> tokenizedBuffer.onDidTokenize(tokenizeCallback) <del> <del> expect(tokenizedBuffer.tokenizedLines[0]).toBeUndefined() <del> expect(tokenizedBuffer.tokenizedLines[1]).toBeUndefined() <del> expect(tokenizedBuffer.tokenizedLines[2]).toBeUndefined() <del> expect(tokenizeCallback.callCount).toBe(0) <del> expect(NullGrammar.tokenizeLine).not.toHaveBeenCalled() <del> <del> fullyTokenize(tokenizedBuffer) <del> expect(tokenizedBuffer.tokenizedLines[0]).toBeUndefined() <del> expect(tokenizedBuffer.tokenizedLines[1]).toBeUndefined() <del> expect(tokenizedBuffer.tokenizedLines[2]).toBeUndefined() <del> expect(tokenizeCallback.callCount).toBe(0) <del> expect(NullGrammar.tokenizeLine).not.toHaveBeenCalled() <del> }) <del> }) <del> <ide> describe('text decoration layer API', () => { <ide> describe('iterator', () => { <ide> it('iterates over the syntactic scope boundaries', () => {
1
Ruby
Ruby
fix mutable constants violations
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c
<ide><path>Library/Homebrew/cask/artifact/installer.rb <ide> module Cask <ide> module Artifact <ide> class Installer < AbstractArtifact <del> VALID_KEYS = Set.new [ <del> :manual, <del> :script, <del> ] <add> VALID_KEYS = Set.new([ <add> :manual, <add> :script, <add> ]).freeze <ide> <ide> module ManualInstaller <ide> def install_phase(**) <ide><path>Library/Homebrew/cask/cmd/internal_stanza.rb <ide> class InternalStanza < AbstractInternalCommand <ide> # <ide> <ide> ARTIFACTS = <del> DSL::ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key) + <del> DSL::ARTIFACT_BLOCK_CLASSES.map(&:dsl_key) <add> (DSL::ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key) + <add> DSL::ARTIFACT_BLOCK_CLASSES.map(&:dsl_key)).freeze <ide> <ide> option "--table", :table, false <ide> option "--quiet", :quiet, false <ide><path>Library/Homebrew/cask/dsl.rb <ide> class DSL <ide> Artifact::Zap, <ide> ].freeze <ide> <del> ACTIVATABLE_ARTIFACT_CLASSES = ORDINARY_ARTIFACT_CLASSES - [Artifact::StageOnly] <add> ACTIVATABLE_ARTIFACT_CLASSES = (ORDINARY_ARTIFACT_CLASSES - [Artifact::StageOnly]).freeze <ide> <ide> ARTIFACT_BLOCK_CLASSES = [ <ide> Artifact::PreflightBlock, <ide> Artifact::PostflightBlock, <ide> ].freeze <ide> <del> DSL_METHODS = Set.new [ <del> :appcast, <del> :artifacts, <del> :auto_updates, <del> :caveats, <del> :conflicts_with, <del> :container, <del> :depends_on, <del> :homepage, <del> :language, <del> :languages, <del> :name, <del> :sha256, <del> :staged_path, <del> :url, <del> :version, <del> :appdir, <del> *ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key), <del> *ACTIVATABLE_ARTIFACT_CLASSES.map(&:dsl_key), <del> *ARTIFACT_BLOCK_CLASSES.flat_map { |klass| [klass.dsl_key, klass.uninstall_dsl_key] }, <del> ].freeze <add> DSL_METHODS = Set.new([ <add> :appcast, <add> :artifacts, <add> :auto_updates, <add> :caveats, <add> :conflicts_with, <add> :container, <add> :depends_on, <add> :homepage, <add> :language, <add> :languages, <add> :name, <add> :sha256, <add> :staged_path, <add> :url, <add> :version, <add> :appdir, <add> *ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key), <add> *ACTIVATABLE_ARTIFACT_CLASSES.map(&:dsl_key), <add> *ARTIFACT_BLOCK_CLASSES.flat_map { |klass| [klass.dsl_key, klass.uninstall_dsl_key] }, <add> ]).freeze <ide> <ide> attr_reader :cask, :token <ide> <ide><path>Library/Homebrew/cask/dsl/container.rb <ide> module Cask <ide> class DSL <ide> class Container <del> VALID_KEYS = Set.new [ <del> :type, <del> :nested, <del> ] <add> VALID_KEYS = Set.new([ <add> :type, <add> :nested, <add> ]).freeze <ide> <ide> attr_accessor(*VALID_KEYS) <ide> attr_accessor :pairs <ide><path>Library/Homebrew/cask/dsl/depends_on.rb <ide> module Cask <ide> class DSL <ide> class DependsOn < DelegateClass(Hash) <del> VALID_KEYS = Set.new [ <del> :formula, <del> :cask, <del> :macos, <del> :arch, <del> :x11, <del> :java, <del> ].freeze <add> VALID_KEYS = Set.new([ <add> :formula, <add> :cask, <add> :macos, <add> :arch, <add> :x11, <add> :java, <add> ]).freeze <ide> <ide> VALID_ARCHES = { <ide> intel: { type: :intel, bits: 64 }, <ide><path>Library/Homebrew/cleanup.rb <ide> module Homebrew <ide> class Cleanup <ide> extend Predicable <ide> <del> PERIODIC_CLEAN_FILE = HOMEBREW_CACHE/".cleaned" <add> PERIODIC_CLEAN_FILE = (HOMEBREW_CACHE/".cleaned").freeze <ide> <ide> attr_predicate :dry_run?, :scrub? <ide> attr_reader :args, :days, :cache <ide><path>Library/Homebrew/compilers.rb <ide> module CompilerConstants <ide> "llvm_clang" => :llvm_clang, <ide> }.freeze <ide> <del> COMPILERS = COMPILER_SYMBOL_MAP.values + <del> GNU_GCC_VERSIONS.map { |n| "gcc-#{n}" } <add> COMPILERS = (COMPILER_SYMBOL_MAP.values + <add> GNU_GCC_VERSIONS.map { |n| "gcc-#{n}" }).freeze <ide> end <ide> <ide> class CompilerFailure <ide><path>Library/Homebrew/config.rb <ide> raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] <ide> <ide> # Path to `bin/brew` main executable in `HOMEBREW_PREFIX` <del>HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]) <add>HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]).freeze <ide> <ide> class MissingEnvironmentVariables < RuntimeError; end <ide> <ide> def get_env_or_raise(env) <ide> ENV[env] <ide> end <ide> <add>require "extend/git_repository" <add> <ide> # Where we link under <del>HOMEBREW_PREFIX = Pathname.new(get_env_or_raise("HOMEBREW_PREFIX")) <add>HOMEBREW_PREFIX = Pathname.new(get_env_or_raise("HOMEBREW_PREFIX")).freeze <ide> <ide> # Where `.git` is found <ide> HOMEBREW_REPOSITORY = Pathname.new(get_env_or_raise("HOMEBREW_REPOSITORY")) <add> .extend(GitRepositoryExtension) <add> .freeze <ide> <ide> # Where we store most of Homebrew, taps, and various metadata <del>HOMEBREW_LIBRARY = Pathname.new(get_env_or_raise("HOMEBREW_LIBRARY")) <add>HOMEBREW_LIBRARY = Pathname.new(get_env_or_raise("HOMEBREW_LIBRARY")).freeze <ide> <ide> # Where shim scripts for various build and SCM tools are stored <del>HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY/"Homebrew/shims" <add>HOMEBREW_SHIMS_PATH = (HOMEBREW_LIBRARY/"Homebrew/shims").freeze <ide> <ide> # Where we store symlinks to currently linked kegs <del>HOMEBREW_LINKED_KEGS = HOMEBREW_PREFIX/"var/homebrew/linked" <add>HOMEBREW_LINKED_KEGS = (HOMEBREW_PREFIX/"var/homebrew/linked").freeze <ide> <ide> # Where we store symlinks to currently version-pinned kegs <del>HOMEBREW_PINNED_KEGS = HOMEBREW_PREFIX/"var/homebrew/pinned" <add>HOMEBREW_PINNED_KEGS = (HOMEBREW_PREFIX/"var/homebrew/pinned").freeze <ide> <ide> # Where we store lock files <del>HOMEBREW_LOCKS = HOMEBREW_PREFIX/"var/homebrew/locks" <add>HOMEBREW_LOCKS = (HOMEBREW_PREFIX/"var/homebrew/locks").freeze <ide> <ide> # Where we store built products <del>HOMEBREW_CELLAR = Pathname.new(get_env_or_raise("HOMEBREW_CELLAR")) <add>HOMEBREW_CELLAR = Pathname.new(get_env_or_raise("HOMEBREW_CELLAR")).freeze <ide> <ide> # Where downloads (bottles, source tarballs, etc.) are cached <del>HOMEBREW_CACHE = Pathname.new(get_env_or_raise("HOMEBREW_CACHE")) <add>HOMEBREW_CACHE = Pathname.new(get_env_or_raise("HOMEBREW_CACHE")).freeze <ide> <ide> # Where brews installed via URL are cached <del>HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE/"Formula" <add>HOMEBREW_CACHE_FORMULA = (HOMEBREW_CACHE/"Formula").freeze <ide> <ide> # Where build, postinstall, and test logs of formulae are written to <del>HOMEBREW_LOGS = Pathname.new(get_env_or_raise("HOMEBREW_LOGS")).expand_path <add>HOMEBREW_LOGS = Pathname.new(get_env_or_raise("HOMEBREW_LOGS")).expand_path.freeze <ide> <ide> # Must use `/tmp` instead of `TMPDIR` because long paths break Unix domain sockets <ide> HOMEBREW_TEMP = begin <ide> tmp = Pathname.new(get_env_or_raise("HOMEBREW_TEMP")) <ide> tmp.mkpath unless tmp.exist? <ide> tmp.realpath <del>end <add>end.freeze <ide><path>Library/Homebrew/debrew.rb <ide> module Debrew <ide> extend Mutex_m <ide> <del> Ignorable = Module.new <add> Ignorable = Module.new.freeze <ide> <ide> module Raise <ide> def raise(*) <ide><path>Library/Homebrew/dependency.rb <ide> class Dependency <ide> <ide> attr_reader :name, :tags, :env_proc, :option_names <ide> <del> DEFAULT_ENV_PROC = proc {} <add> DEFAULT_ENV_PROC = proc {}.freeze <ide> <ide> def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name]) <ide> raise ArgumentError, "Dependency must have a name!" unless name <ide><path>Library/Homebrew/dev-cmd/man.rb <ide> module Homebrew <ide> module_function <ide> <del> SOURCE_PATH = HOMEBREW_LIBRARY_PATH/"manpages" <del> TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages" <del> TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs" <add> SOURCE_PATH = (HOMEBREW_LIBRARY_PATH/"manpages").freeze <add> TARGET_MAN_PATH = (HOMEBREW_REPOSITORY/"manpages").freeze <add> TARGET_DOC_PATH = (HOMEBREW_REPOSITORY/"docs").freeze <ide> <ide> def man_args <ide> Homebrew::CLI::Parser.new do <ide><path>Library/Homebrew/extend/os/mac/keg.rb <ide> class Keg <del> GENERIC_KEG_LINK_DIRECTORIES = remove_const :KEG_LINK_DIRECTORIES <add> GENERIC_KEG_LINK_DIRECTORIES = (remove_const :KEG_LINK_DIRECTORIES).freeze <ide> KEG_LINK_DIRECTORIES = (GENERIC_KEG_LINK_DIRECTORIES + ["Frameworks"]).freeze <ide> end <ide><path>Library/Homebrew/global.rb <ide> require "messages" <ide> require "system_command" <ide> <del>ARGV_WITHOUT_MONKEY_PATCHING = ARGV.dup <add>ARGV_WITHOUT_MONKEY_PATCHING = ARGV.dup.freeze <ide> ARGV.extend(HomebrewArgvExtension) <ide> <ide> HOMEBREW_PRODUCT = ENV["HOMEBREW_PRODUCT"] <ide> HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"] <ide> HOMEBREW_WWW = "https://brew.sh".freeze <ide> <del>require "extend/git_repository" <del> <del>HOMEBREW_REPOSITORY.extend(GitRepositoryExtension) <del> <ide> require "rbconfig" <ide> <del>RUBY_PATH = Pathname.new(RbConfig.ruby) <del>RUBY_BIN = RUBY_PATH.dirname <add>RUBY_PATH = Pathname.new(RbConfig.ruby).freeze <add>RUBY_BIN = RUBY_PATH.dirname.freeze <ide> <ide> HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"] <ide> HOMEBREW_USER_AGENT_RUBY = <ide><path>Library/Homebrew/keg.rb <ide> def to_s <ide> <ide> # Keep relatively in sync with <ide> # https://github.com/Homebrew/install/blob/master/install <del> MUST_EXIST_DIRECTORIES = MUST_EXIST_SUBDIRECTORIES + [ <add> MUST_EXIST_DIRECTORIES = (MUST_EXIST_SUBDIRECTORIES + [ <ide> HOMEBREW_CELLAR, <del> ].uniq.sort.freeze <add> ].sort.uniq).freeze <ide> MUST_BE_WRITABLE_DIRECTORIES = ( <ide> %w[ <ide> etc/bash_completion.d lib/pkgconfig <ide><path>Library/Homebrew/load_path.rb <ide> require "pathname" <ide> <del>HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath <add>HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze <ide> <ide> $LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.to_s) unless $LOAD_PATH.include?(HOMEBREW_LIBRARY_PATH.to_s) <ide> <ide><path>Library/Homebrew/metafiles.rb <ide> module Metafiles <ide> # https://github.com/github/markup#markups <del> EXTENSIONS = Set.new %w[ <del> .adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn <del> .org .pod .rdoc .rst .rtf .textile .txt .wiki <del> ].freeze <del> BASENAMES = Set.new %w[ <del> about authors changelog changes copying copyright history license licence <del> news notes notice readme todo <del> ].freeze <add> EXTENSIONS = Set.new(%w[ <add> .adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn <add> .org .pod .rdoc .rst .rtf .textile .txt .wiki <add> ]).freeze <add> BASENAMES = Set.new(%w[ <add> about authors changelog changes copying copyright history license licence <add> news notes notice readme todo <add> ]).freeze <ide> <ide> module_function <ide> <ide><path>Library/Homebrew/os/linux.rb <ide> module OS <ide> module Mac <ide> module_function <ide> <del> ::MacOS = self # rubocop:disable Naming/ConstantName <add> # rubocop:disable Naming/ConstantName <add> # rubocop:disable Style/MutableConstant <add> ::MacOS = self <add> # rubocop:enable Naming/ConstantName <add> # rubocop:enable Style/MutableConstant <ide> <ide> raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] <ide> <ide><path>Library/Homebrew/os/linux/global.rb <ide> module Homebrew <ide> "/usr/local".freeze <ide> else <ide> "/home/linuxbrew/.linuxbrew".freeze <del> end <add> end.freeze <ide> end <ide><path>Library/Homebrew/os/mac.rb <ide> module OS <ide> module Mac <ide> module_function <ide> <del> ::MacOS = self # rubocop:disable Naming/ConstantName <add> # rubocop:disable Naming/ConstantName <add> # rubocop:disable Style/MutableConstant <add> ::MacOS = self <add> # rubocop:enable Naming/ConstantName <add> # rubocop:enable Style/MutableConstant <ide> <ide> raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] <ide> <ide><path>Library/Homebrew/os/mac/xquartz.rb <ide> module OS <ide> module Mac <del> X11 = XQuartz = Module.new <add> X11 = XQuartz = Module.new # rubocop:disable Style/MutableConstant <ide> <ide> module XQuartz <ide> module_function <ide><path>Library/Homebrew/rubocops/cask/homepage_matches_url.rb <ide> class HomepageMatchesUrl < Cop # rubocop:disable Metrics/ClassLength <ide> <ide> MSG_NO_MATCH = "`%{url}` does not match `%{full_url}`".freeze <ide> <del> MSG_MISSING = "`%{domain}` does not match `%{homepage}`, a comment has to be added " \ <del> "above the `url` stanza. For details, see " + REFERENCE_URL <add> MSG_MISSING = ("`%{domain}` does not match `%{homepage}`, a comment has to be added " \ <add> "above the `url` stanza. For details, see " + REFERENCE_URL).freeze <ide> <del> MSG_WRONG_FORMAT = "`%{comment}` does not match the expected comment format. " \ <del> "For details, see " + REFERENCE_URL <add> MSG_WRONG_FORMAT = ("`%{comment}` does not match the expected comment format. " \ <add> "For details, see " + REFERENCE_URL).freeze <ide> <ide> MSG_UNNECESSARY = "The URL's domain `%{domain}` matches the homepage `%{homepage}`, " \ <ide> "the comment above the `url` stanza is unnecessary".freeze <ide><path>Library/Homebrew/tap.rb <ide> class Tap <ide> extend Cachable <ide> <del> TAP_DIRECTORY = HOMEBREW_LIBRARY/"Taps" <add> TAP_DIRECTORY = (HOMEBREW_LIBRARY/"Taps").freeze <ide> <ide> def self.fetch(*args) <ide> case args.length <ide><path>Library/Homebrew/tap_constants.rb <ide> # match taps' directory paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap <ide> HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/(?<user>[\w-]+)/(?<repo>[\w-]+)}.freeze <ide> # match taps' formula paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula <del>HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{(?:/.*)?$}.source) <add>HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source + %r{(?:/.*)?$}.source).freeze <ide> # match official taps' casks, e.g. homebrew/cask/somecask or homebrew/cask-versions/somecask <ide> HOMEBREW_CASK_TAP_CASK_REGEX = %r{^(?:([Cc]askroom)/(cask|versions)|(homebrew)/(cask|cask-[\w-]+))/([\w+-.]+)$}.freeze <ide> HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX = /^(home|linux)brew-/.freeze <ide><path>Library/Homebrew/test/patching_spec.rb <ide> TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze <ide> PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff".freeze <ide> PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff".freeze <del> PATCH_A_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/noop-a.diff" <del> PATCH_B_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/noop-b.diff" <add> PATCH_A_CONTENTS = File.read("#{TEST_FIXTURE_DIR}/patches/noop-a.diff").freeze <add> PATCH_B_CONTENTS = File.read("#{TEST_FIXTURE_DIR}/patches/noop-b.diff").freeze <ide> APPLY_A = "noop-a.diff".freeze <ide> APPLY_B = "noop-b.diff".freeze <ide> APPLY_C = "noop-c.diff".freeze <ide><path>Library/Homebrew/test/support/lib/config.rb <ide> <ide> require "pathname" <ide> <del>HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]) <add>HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]).freeze <ide> <ide> TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k| <ide> dir = Dir.mktmpdir("homebrew-tests-", ENV["HOMEBREW_TEMP"] || "/tmp") <ide> FileUtils.remove_entry(dir) unless ENV["HOMEBREW_TEST_NO_EXIT_CLEANUP"] <ide> end <ide> ENV[k] = dir <del>end <add>end.freeze <ide> <ide> # Paths pointing into the Homebrew code base that persist across test runs <del>HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent/"Homebrew/shims" <add>HOMEBREW_SHIMS_PATH = (HOMEBREW_LIBRARY_PATH.parent/"Homebrew/shims").freeze <add> <add>require "extend/git_repository" <ide> <ide> # Paths redirected to a temporary directory and wiped at the end of the test run <del>HOMEBREW_PREFIX = Pathname(TEST_TMPDIR)/"prefix" <del>HOMEBREW_REPOSITORY = HOMEBREW_PREFIX <del>HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY/"Library" <del>HOMEBREW_CACHE = HOMEBREW_PREFIX.parent/"cache" <del>HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent/"formula_cache" <del>HOMEBREW_LINKED_KEGS = HOMEBREW_PREFIX.parent/"linked" <del>HOMEBREW_PINNED_KEGS = HOMEBREW_PREFIX.parent/"pinned" <del>HOMEBREW_LOCKS = HOMEBREW_PREFIX.parent/"locks" <del>HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent/"cellar" <del>HOMEBREW_LOGS = HOMEBREW_PREFIX.parent/"logs" <del>HOMEBREW_TEMP = HOMEBREW_PREFIX.parent/"temp" <del> <del>TEST_FIXTURE_DIR = HOMEBREW_LIBRARY_PATH/"test/support/fixtures" <add>HOMEBREW_PREFIX = (Pathname(TEST_TMPDIR)/"prefix").freeze <add>HOMEBREW_REPOSITORY = HOMEBREW_PREFIX.dup.extend(GitRepositoryExtension).freeze <add>HOMEBREW_LIBRARY = (HOMEBREW_REPOSITORY/"Library").freeze <add>HOMEBREW_CACHE = (HOMEBREW_PREFIX.parent/"cache").freeze <add>HOMEBREW_CACHE_FORMULA = (HOMEBREW_PREFIX.parent/"formula_cache").freeze <add>HOMEBREW_LINKED_KEGS = (HOMEBREW_PREFIX.parent/"linked").freeze <add>HOMEBREW_PINNED_KEGS = (HOMEBREW_PREFIX.parent/"pinned").freeze <add>HOMEBREW_LOCKS = (HOMEBREW_PREFIX.parent/"locks").freeze <add>HOMEBREW_CELLAR = (HOMEBREW_PREFIX.parent/"cellar").freeze <add>HOMEBREW_LOGS = (HOMEBREW_PREFIX.parent/"logs").freeze <add>HOMEBREW_TEMP = (HOMEBREW_PREFIX.parent/"temp").freeze <add> <add>TEST_FIXTURE_DIR = (HOMEBREW_LIBRARY_PATH/"test/support/fixtures").freeze <ide> <ide> TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b".freeze <ide> TESTBALL_PATCHES_SHA256 = "799c2d551ac5c3a5759bea7796631a7906a6a24435b52261a317133a0bfb34d9".freeze <ide><path>Library/Homebrew/unpack_strategy/dmg.rb <ide> class Dmg <ide> include UnpackStrategy <ide> <ide> module Bom <del> DMG_METADATA = Set.new %w[ <del> .background <del> .com.apple.timemachine.donotpresent <del> .com.apple.timemachine.supported <del> .DocumentRevisions-V100 <del> .DS_Store <del> .fseventsd <del> .MobileBackups <del> .Spotlight-V100 <del> .TemporaryItems <del> .Trashes <del> .VolumeIcon.icns <del> ].freeze <add> DMG_METADATA = Set.new(%w[ <add> .background <add> .com.apple.timemachine.donotpresent <add> .com.apple.timemachine.supported <add> .DocumentRevisions-V100 <add> .DS_Store <add> .fseventsd <add> .MobileBackups <add> .Spotlight-V100 <add> .TemporaryItems <add> .Trashes <add> .VolumeIcon.icns <add> ]).freeze <ide> private_constant :DMG_METADATA <ide> <ide> refine Pathname do <ide><path>Library/Homebrew/version.rb <ide> def inspect <ide> end <ide> end <ide> <del> NULL_TOKEN = NullToken.new <add> NULL_TOKEN = NullToken.new.freeze <ide> <ide> class StringToken < Token <ide> PATTERN = /[a-z]+[0-9]*/i.freeze <ide> def <=>(other) <ide> PatchToken::PATTERN, <ide> NumericToken::PATTERN, <ide> StringToken::PATTERN, <del> ) <add> ).freeze <ide> <ide> class FromURL < Version <ide> def detected_from_url? <ide><path>Library/Homebrew/version/null.rb <ide> def to_s <ide> def inspect <ide> "#<Version::NULL>".freeze <ide> end <del> end.new <add> end.new.freeze <ide> end
28
Python
Python
add required packages which are missing.
579ef7d6fef0f0104f7b5e01dfa18ea085e42a83
<ide><path>research/setup.py <ide> from setuptools import setup <ide> <ide> <del>REQUIRED_PACKAGES = ['Pillow>=1.0'] <add>REQUIRED_PACKAGES = ['Pillow>=1.0', 'Matplotlib>=2.1', 'Cython>=0.28.1'] <ide> <ide> setup( <ide> name='object_detection',
1
Javascript
Javascript
correct small typo
774b2adb89d0d4334ce707ddd456fe96e8546e97
<ide><path>src/ng/interpolate.js <ide> function $InterpolateProvider() { <ide> * Use {@link ng.$interpolateProvider#methods_endSymbol $interpolateProvider#endSymbol} to change <ide> * the symbol. <ide> * <del> * @returns {string} start symbol. <add> * @returns {string} end symbol. <ide> */ <ide> $interpolate.endSymbol = function() { <ide> return endSymbol;
1
Javascript
Javascript
fix no shadow warnings
2c3f807ace66b943416bfda103bb063a63a03d41
<ide><path>Libraries/Interaction/__tests__/InteractionManager-test.js <ide> describe('promise tasks', () => { <ide> expectToBeCalledOnce(task2); <ide> }); <ide> <del> const bigAsyncTest = resolve => { <add> const bigAsyncTest = resolveTest => { <ide> jest.useRealTimers(); <ide> <ide> const task1 = createSequenceTask(1); <ide> describe('promise tasks', () => { <ide> expectToBeCalledOnce(task5); <ide> expectToBeCalledOnce(task6); <ide> <del> resolve(); <add> resolveTest(); <ide> }, 100); <ide> }; <ide> <ide><path>Libraries/Lists/__tests__/VirtualizedList-test.js <ide> describe('VirtualizedList', () => { <ide> const props = { <ide> data, <ide> renderItem: ({item}) => <item value={item.key} />, <del> getItem: (data, index) => data[index], <del> getItemCount: data => data.length, <del> getItemLayout: (data, index) => ({ <add> getItem: (items, index) => items[index], <add> getItemCount: items => items.length, <add> getItemLayout: (items, index) => ({ <ide> length: ITEM_HEIGHT, <ide> offset: ITEM_HEIGHT * index, <ide> index, <ide><path>react-native-git-upgrade/cliEntry.js <ide> stdout: ${stdout}`), <ide> }); <ide> } <ide> <del>function parseJsonFile(path, useYarn) { <add>function parseJsonFile(filePath, useYarn) { <ide> const installHint = useYarn <ide> ? 'Make sure you ran "yarn" and that you are inside a React Native project.' <ide> : 'Make sure you ran "npm install" and that you are inside a React Native project.'; <ide> let fileContents; <ide> try { <del> fileContents = fs.readFileSync(path, 'utf8'); <add> fileContents = fs.readFileSync(filePath, 'utf8'); <ide> } catch (err) { <del> throw new Error('Cannot find "' + path + '". ' + installHint); <add> throw new Error('Cannot find "' + filePath + '". ' + installHint); <ide> } <ide> try { <ide> return JSON.parse(fileContents); <ide> } catch (err) { <del> throw new Error('Cannot parse "' + path + '": ' + err.message); <add> throw new Error('Cannot parse "' + filePath + '": ' + err.message); <ide> } <ide> } <ide> <ide><path>scripts/android-e2e-test.js <ide> describe('Android Test App', function() { <ide> driver.on('status', function(info) { <ide> console.log(info.cyan); <ide> }); <del> driver.on('command', function(method, path, data) { <del> if (path === 'source()' && data) { <add> driver.on('command', function(method, command, data) { <add> if (command === 'source()' && data) { <ide> console.log( <ide> ' > ' + method.yellow, <ide> 'Screen contents'.grey, <ide> '\n', <ide> pd.xml(data).yellow, <ide> ); <ide> } else { <del> console.log(' > ' + method.yellow, path.grey, data || ''); <add> console.log(' > ' + method.yellow, command.grey, data || ''); <ide> } <ide> }); <del> driver.on('http', function(method, path, data) { <del> console.log(' > ' + method.magenta, path, (data || '').grey); <add> driver.on('http', function(method, urlPath, data) { <add> console.log(' > ' + method.magenta, urlPath, (data || '').grey); <ide> }); <ide> <ide> // every interval print what is on the screen
4
Text
Text
use serial comma in worker_threads docs
ca0044bd1d221df7d3efbf735a1a98e2e1fef731
<ide><path>doc/api/worker_threads.md <ide> circularData.foo = circularData; <ide> port2.postMessage(circularData); <ide> ``` <ide> <del>`transferList` may be a list of [`ArrayBuffer`][], [`MessagePort`][] and <add>`transferList` may be a list of [`ArrayBuffer`][], [`MessagePort`][], and <ide> [`FileHandle`][] objects. <ide> After transferring, they are not usable on the sending side of the channel <ide> anymore (even if they are not contained in `value`). Unlike with <ide> Most Node.js APIs are available inside of it. <ide> <ide> Notable differences inside a Worker environment are: <ide> <del>* The [`process.stdin`][], [`process.stdout`][] and [`process.stderr`][] <del> may be redirected by the parent thread. <add>* The [`process.stdin`][], [`process.stdout`][], and [`process.stderr`][] <add> streams may be redirected by the parent thread. <ide> * The [`require('node:worker_threads').isMainThread`][] property is set to `false`. <ide> * The [`require('node:worker_threads').parentPort`][] message port is available. <ide> * [`process.exit()`][] does not stop the whole program, just the single thread,
1
Python
Python
fix hyperlink misrendering in documentation
672028a5f2712f8f65b4d97c617a25d81972775e
<ide><path>docs/autogen.py <ide> def process_class_docstring(docstring): <ide> r'\n __\1__\n\n', <ide> docstring) <ide> <del> docstring = re.sub(r' ([^\s\\]+):(.*)\n', <add> docstring = re.sub(r' ([^\s\\\(]+):(.*)\n', <ide> r' - __\1__:\2\n', <ide> docstring) <ide> <ide> def process_function_docstring(docstring): <ide> r'\n __\1__\n\n', <ide> docstring) <ide> <del> docstring = re.sub(r' ([^\s\\]+):(.*)\n', <add> docstring = re.sub(r' ([^\s\\\(]+):(.*)\n', <ide> r' - __\1__:\2\n', <ide> docstring) <ide>
1
Ruby
Ruby
remove helper script
d49100487944014a2c8a554e1eff257addddf460
<ide><path>Library/add-typed.rb <del>#!/usr/bin/env ruby <del> <del>require 'pathname' <del>require 'open3' <del> <del> <del>Dir.chdir "#{__dir__}/Homebrew" <del> <del>files = Pathname.glob("**/*.rb").reject { |path| path.to_s.start_with?("vendor/") } <del> <del>files.each do |file| <del> <del> content = file.read <del> <del> if content.start_with?("# typed: ") <del> puts "Already typed: #{file}" <del> next <del> end <del> <del> ['strict', 'true', 'false', 'ignore'].each do |level| <del> puts "Trying #{file} with level #{level}." <del> file.write "# typed: #{level}\n#{content.strip}\n" <del> <del> output, status = Open3.capture2e('brew', 'typecheck') <del> break if status.success? <del> end <del>end
1
Javascript
Javascript
remove navigator recommendation
a0304327a9c1989b49ac4c106d824e2b31a6cc16
<ide><path>Libraries/Components/Navigation/NavigatorIOS.ios.js <ide> type Event = Object; <ide> * animations and behavior from UIKIt. <ide> * <ide> * As the name implies, it is only available on iOS. Take a look at <del> * [`Navigator`](docs/navigator.html) for a similar solution for your <del> * cross-platform needs, or check out <del> * [react-native-navigation](https://github.com/wix/react-native-navigation), a <del> * component that aims to provide native navigation on both iOS and Android. <add> * [`React Navigation`](https://reactnavigation.org/) for a cross-platform <add> * solution in JavaScript, or check out either of these components for native <add> * solutions: [native-navigation](http://airbnb.io/native-navigation/), <add> * [react-native-navigation](https://github.com/wix/react-native-navigation). <ide> * <ide> * To set up the navigator, provide the `initialRoute` prop with a route <ide> * object. A route object is used to describe each scene that your app
1
Javascript
Javascript
skip long path tests on non-windows
19e06d71cfa26b6f8a1ce0fa566891553eb351b2
<ide><path>test/parallel/test-fs-long-path.js <ide> var fs = require('fs'); <ide> var path = require('path'); <ide> var assert = require('assert'); <ide> <add>if (!common.isWindows) { <add> console.log('1..0 # Skipped: this test is Windows-specific.'); <add> return; <add>} <add> <ide> var successes = 0; <ide> <ide> // make a path that will be at least 260 chars long. <ide><path>test/parallel/test-require-long-path.js <ide> const common = require('../common'); <ide> const fs = require('fs'); <ide> const path = require('path'); <ide> <add>if (!common.isWindows) { <add> console.log('1..0 # Skipped: this test is Windows-specific.'); <add> return; <add>} <add> <ide> // make a path that is more than 260 chars long. <ide> const dirNameLen = Math.max(260 - common.tmpDir.length, 1); <ide> const dirName = path.join(common.tmpDir, 'x'.repeat(dirNameLen));
2
Text
Text
correct the codeblock for `hmacimportparams.hash`
f1c196d6a49edf3d26338a39a3b16b6ca39a95a1
<ide><path>doc/api/webcrypto.md <ide> digest, the salt should be 256-bits of random data). <ide> added: v15.0.0 <ide> --> <ide> <del>#### 'hmacImportParams.hash` <add>#### `hmacImportParams.hash` <ide> <!-- YAML <ide> added: v15.0.0 <ide> -->
1
Java
Java
improve performance of numberutils
48b965ad333da1b4b8fb67dd5a08ad985b5ad135
<ide><path>spring-core/src/main/java/org/springframework/util/NumberUtils.java <ide> else if (Byte.class == targetClass) { <ide> if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) { <ide> raiseOverflowException(number, targetClass); <ide> } <del> return (T) new Byte(number.byteValue()); <add> return (T) Byte.valueOf(number.byteValue()); <ide> } <ide> else if (Short.class == targetClass) { <ide> long value = number.longValue(); <ide> if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) { <ide> raiseOverflowException(number, targetClass); <ide> } <del> return (T) new Short(number.shortValue()); <add> return (T) Short.valueOf(number.shortValue()); <ide> } <ide> else if (Integer.class == targetClass) { <ide> long value = number.longValue(); <ide> if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) { <ide> raiseOverflowException(number, targetClass); <ide> } <del> return (T) new Integer(number.intValue()); <add> return (T) Integer.valueOf(number.intValue()); <ide> } <ide> else if (Long.class == targetClass) { <ide> BigInteger bigInt = null; <ide> else if (number instanceof BigDecimal) { <ide> if (bigInt != null && (bigInt.compareTo(LONG_MIN) < 0 || bigInt.compareTo(LONG_MAX) > 0)) { <ide> raiseOverflowException(number, targetClass); <ide> } <del> return (T) new Long(number.longValue()); <add> return (T) Long.valueOf(number.longValue()); <ide> } <ide> else if (BigInteger.class == targetClass) { <ide> if (number instanceof BigDecimal) { <ide> else if (BigInteger.class == targetClass) { <ide> } <ide> } <ide> else if (Float.class == targetClass) { <del> return (T) new Float(number.floatValue()); <add> return (T) Float.valueOf(number.floatValue()); <ide> } <ide> else if (Double.class == targetClass) { <del> return (T) new Double(number.doubleValue()); <add> return (T) Double.valueOf(number.doubleValue()); <ide> } <ide> else if (BigDecimal.class == targetClass) { <ide> // always use BigDecimal(String) here to avoid unpredictability of BigDecimal(double)
1
Javascript
Javascript
implement reference testing for printing
8ccf09d5dd410a7ebd9c048b91bbd73fa7f7e5ba
<ide><path>test/driver.js <ide> var Driver = (function DriverClosure() { <ide> <ide> // Initialize various `eq` test subtypes, see comment below. <ide> var renderAnnotations = false, <del> renderForms = false; <add> renderForms = false, <add> renderPrint = false; <ide> <ide> var textLayerCanvas, annotationLayerCanvas; <ide> var initPromise; <ide> var Driver = (function DriverClosure() { <ide> // accidentally changing the behaviour for other types of tests. <ide> renderAnnotations = !!task.annotations; <ide> renderForms = !!task.forms; <add> renderPrint = !!task.print; <ide> <ide> // Render the annotation layer if necessary. <ide> if (renderAnnotations || renderForms) { <ide> var Driver = (function DriverClosure() { <ide> viewport, <ide> renderInteractiveForms: renderForms, <ide> }; <add> if (renderPrint) { <add> const annotationStorage = task.annotationStorage; <add> if (annotationStorage) { <add> const docAnnotationStorage = task.pdfDoc.annotationStorage; <add> const entries = Object.entries(annotationStorage); <add> for (const [key, value] of entries) { <add> docAnnotationStorage.setValue(key, value); <add> } <add> renderContext.annotationStorage = docAnnotationStorage; <add> } <add> renderContext.intent = "print"; <add> } <add> <ide> var completeRender = function (error) { <ide> // if text layer is present, compose it on top of the page <ide> if (textLayerCanvas) {
1
Text
Text
add info for siri shortcuts
aa5314ff59bdca50998961ec5835d3e228514ec4
<ide><path>guide/english/voice/index.md <ide> The software components within the platform include both Natural Language Unders <ide> <ide> IBM Watson Speech-to-Text uses machine learning to accurately predict speech in real time. Currently seven different languages are supported, as well as live voice and pre-recorded audio. The API can be used for free, or paid versions are available for larger scale apps. <ide> <add>### Siri <ide> <del>### More Information <del>[Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) <del>[Alexa API](https://developer.amazon.com/docs/alexa-voice-service/api-overview.html) <del>[IBM Watson API](https://www.ibm.com/watson/services/speech-to-text/) <add>Apple's iOS 12 update introduced [Siri](https://en.wikipedia.org/wiki/Siri) Shortcuts, which supports the use of third-party applications through Apple's digital voice assistant. Siri Shortcuts allows developers to add shortcuts and personalized phrases to Siri through their applications by, for example, letting the user record a voice phrase for a particular action and adding that phrase to Siri. <add> <add>#### More Information <add> <add>- [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) <add>- [Alexa API](https://developer.amazon.com/docs/alexa-voice-service/api-overview.html) <add>- [IBM Watson API](https://www.ibm.com/watson/services/speech-to-text/) <add>- [Sirikit](https://developer.apple.com/documentation/sirikit) <ide> <ide> <ide>
1
Ruby
Ruby
pass template object to handler#compile
1959db324653d5db345b935c9d2696c544d836af
<ide><path>actionpack/lib/action_view/template_handlers/builder.rb <ide> def compile(template) <ide> content_type_handler = (@view.send!(:controller).respond_to?(:response) ? "controller.response" : "controller") <ide> "#{content_type_handler}.content_type ||= Mime::XML\n" + <ide> "xml = ::Builder::XmlMarkup.new(:indent => 2)\n" + <del> template + <add> template.source + <ide> "\nxml.target!\n" <ide> end <ide> <ide><path>actionpack/lib/action_view/template_handlers/compilable.rb <ide> def compiled_method_name_file_path_segment(file_name) <ide> <ide> # Method to create the source code for a given template. <ide> def create_template_source(template, render_symbol) <del> body = compile(template.source) <add> body = compile(template) <ide> <ide> self.template_args[render_symbol] ||= {} <ide> locals_keys = self.template_args[render_symbol].keys | template.locals.keys <ide><path>actionpack/lib/action_view/template_handlers/erb.rb <ide> class ERB < TemplateHandler <ide> include Compilable <ide> <ide> def compile(template) <del> ::ERB.new(template, nil, @view.erb_trim_mode).src <add> ::ERB.new(template.source, nil, @view.erb_trim_mode).src <ide> end <ide> <ide> def cache_fragment(block, name = {}, options = nil) #:nodoc: <ide><path>actionpack/lib/action_view/template_handlers/rjs.rb <ide> def self.line_offset <ide> <ide> def compile(template) <ide> "controller.response.content_type ||= Mime::JS\n" + <del> "update_page do |page|\n#{template}\nend" <add> "update_page do |page|\n#{template.source}\nend" <ide> end <ide> <ide> def cache_fragment(block, name = {}, options = nil) #:nodoc:
4
Python
Python
fix minor typos in tests
885db908d58838852e5c6b94090c9d00dfbb621a
<ide><path>tests/api/auth/test_client.py <ide> class TestGetCurrentApiClient(unittest.TestCase): <ide> ("cli", 'api_client'): 'airflow.api.client.json_client', <ide> ("cli", 'endpoint_url'): 'http://localhost:1234', <ide> }) <del> def test_should_create_cllient(self, mock_client): <add> def test_should_create_client(self, mock_client): <ide> result = get_current_api_client() <ide> <ide> mock_client.assert_called_once_with( <ide><path>tests/core/test_configuration.py <ide> def test_command_from_env(self): <ide> self.assertEqual(test_cmdenv_conf.get('testcmdenv', 'itsacommand'), 'OK') <ide> # AIRFLOW__TESTCMDENV__NOTACOMMAND_CMD maps to no entry in sensitive_config_values and therefore <ide> # the option should return 'OK' from the configuration, and must not return 'NOT OK' from <del> # the environement variable's echo command <add> # the environment variable's echo command <ide> self.assertEqual(test_cmdenv_conf.get('testcmdenv', 'notacommand'), 'OK') <ide> <ide> def test_parameterized_config_gen(self): <ide><path>tests/providers/google/firebase/hooks/test_firestore.py <ide> ) <ide> <ide> EXPORT_DOCUMENT_BODY = { <del> "outputUriPrefix": "gs://test-bucket/test-naamespace/", <add> "outputUriPrefix": "gs://test-bucket/test-namespace/", <ide> "collectionIds": ["test-collection"], <ide> } <ide> <ide><path>tests/providers/google/firebase/operators/test_firestore.py <ide> TEST_PROJECT_ID: str = "test-project-id" <ide> <ide> EXPORT_DOCUMENT_BODY = { <del> "outputUriPrefix": "gs://test-bucket/test-naamespace/", <add> "outputUriPrefix": "gs://test-bucket/test-namespace/", <ide> "collectionIds": ["test-collection"], <ide> } <ide> <ide><path>tests/providers/mysql/hooks/test_mysql.py <ide> def test_mysql_hook_test_bulk_dump(self, client): <ide> with MySqlContext(client): <ide> hook = MySqlHook('airflow_db') <ide> priv = hook.get_first("SELECT @@global.secure_file_priv") <del> # Use random names to alllow re-running <add> # Use random names to allow re-running <ide> if priv and priv[0]: <ide> # Confirm that no error occurs <ide> hook.bulk_dump(
5
Javascript
Javascript
use slab allocator
f210530f46e8ddbd9e7cc0d0c37778888c27f526
<ide><path>lib/tls.js <ide> function convertNPNProtocols(NPNProtocols, out) { <ide> } <ide> } <ide> <add> <add>function SlabBuffer() { <add> this.create(); <add>}; <add> <add> <add>SlabBuffer.prototype.create = function create() { <add> this.isFull = false; <add> this.pool = new Buffer(10 * 1024 * 1024); <add> this.offset = 0; <add> this.remaining = this.pool.length; <add>}; <add> <add> <add>SlabBuffer.prototype.use = function use(context, fn) { <add> if (this.remaining === 0) { <add> this.isFull = true; <add> return 0; <add> } <add> <add> var bytes = fn.call(context, this.pool, this.offset, this.remaining); <add> <add> if (bytes > 0) { <add> this.offset += bytes; <add> this.remaining -= bytes; <add> } <add> <add> assert(this.remaining >= 0); <add> <add> return bytes; <add>}; <add> <add> <add>var slabBuffer = new SlabBuffer(); <add> <add> <ide> // Base class of both CleartextStream and EncryptedStream <ide> function CryptoStream(pair) { <ide> Stream.call(this); <ide> function CryptoStream(pair) { <ide> this._pending = []; <ide> this._pendingCallbacks = []; <ide> this._pendingBytes = 0; <add> this._buffer = slabBuffer; <ide> } <ide> util.inherits(CryptoStream, Stream); <ide> <ide> CryptoStream.prototype._push = function() { <ide> } <ide> <ide> while (!this._paused) { <del> var chunkBytes = 0; <del> if (!this._pool || (this._poolStart >= this._poolEnd)) { <del> this._pool = new Buffer(16 * 4096); <del> this._poolStart = 0; <del> this._poolEnd = this._pool.length; <del> } <del> var start = this._poolStart; <add> var chunkBytes = 0, <add> bytesRead = 0, <add> start = this._buffer.offset; <ide> <ide> do { <del> chunkBytes = this._pusher(this._pool, <del> this._poolStart, <del> this._poolEnd - this._poolStart); <add> chunkBytes = this._buffer.use(this, this._pusher); <add> if (chunkBytes > 0) bytesRead += chunkBytes; <ide> <ide> if (this.pair.ssl && this.pair.ssl.error) { <ide> this.pair.error(); <ide> CryptoStream.prototype._push = function() { <ide> <ide> this.pair.maybeInitFinished(); <ide> <del> if (chunkBytes >= 0) { <del> this._poolStart += chunkBytes; <del> } <add> } while (chunkBytes > 0 && !this._buffer.isFull); <ide> <del> } while (chunkBytes > 0 && this._poolStart < this._poolEnd); <add> var pool = this._buffer.pool; <ide> <del> var bytesRead = this._poolStart - start; <add> // Create new buffer if previous was filled up <add> if (this._buffer.isFull) this._buffer.create(); <ide> <ide> assert(bytesRead >= 0); <ide> <ide> CryptoStream.prototype._push = function() { <ide> return; <ide> } <ide> <del> var chunk = this._pool.slice(start, this._poolStart); <add> var chunk = pool.slice(start, start + bytesRead); <ide> <ide> if (this === this.pair.cleartext) { <ide> debug('cleartext emit "data" with ' + bytesRead + ' bytes'); <ide> CryptoStream.prototype._push = function() { <ide> } <ide> <ide> // Optimization: emit the original buffer with end points <del> if (this.ondata) this.ondata(this._pool, start, this._poolStart); <add> if (this.ondata) this.ondata(pool, start, start + bytesRead); <ide> } <ide> }; <ide>
1
Javascript
Javascript
add missing width & height attrs
ed71513b99efa509598183c0b08decba35bfc3fd
<ide><path>examples/cartogram/cartogram.js <ide> var data = [ <ide> .169, , .132, .167, .139, .184, .159, .14, .146, .157, , .139, .183, .16, .143 <ide> ]; <ide> <del>var svg = d3.select("#chart") <del> .append("svg:svg"); <add>var svg = d3.select("#chart").append("svg:svg") <add> .attr("width", 960) <add> .attr("height", 500); <ide> <ide> d3.json("../data/us-states.json", function(json) { <ide> var path = d3.geo.path();
1
Javascript
Javascript
fix regression in doctool
572e28efa2e3cde78b5e7984b7760fd4c270f619
<ide><path>tools/doc/generate.js <ide> args.forEach(function(arg) { <ide> } <ide> }); <ide> <add>nodeVersion = nodeVersion || process.version; <add> <ide> if (!inputFile) { <ide> throw new Error('No input file specified'); <ide> } <ide> function next(er, input) { <ide> break; <ide> <ide> case 'html': <del> require('./html.js')({ <del> input: input, <del> filename: inputFile, <del> template: template, <del> nodeVersion: nodeVersion, <del> }, function(er, html) { <del> if (er) throw er; <del> console.log(html); <del> }); <add> require('./html.js')(input, inputFile, template, nodeVersion, <add> function(er, html) { <add> if (er) throw er; <add> console.log(html); <add> }); <ide> break; <ide> <ide> default: <ide><path>tools/doc/html.js <ide> var gtocPath = path.resolve(path.join( <ide> var gtocLoading = null; <ide> var gtocData = null; <ide> <del>/** <del> * opts: input, filename, template, nodeVersion. <del> */ <del>function toHTML(opts, cb) { <del> var template = opts.template; <add>function toHTML(input, filename, template, nodeVersion, cb) { <add> if (typeof nodeVersion === 'function') { <add> cb = nodeVersion; <add> nodeVersion = null; <add> } <add> nodeVersion = nodeVersion || process.version; <ide> <ide> if (gtocData) { <ide> return onGtocLoaded(); <ide> function toHTML(opts, cb) { <ide> } <ide> <ide> function onGtocLoaded() { <del> var lexed = marked.lexer(opts.input); <add> var lexed = marked.lexer(input); <ide> fs.readFile(template, 'utf8', function(er, template) { <ide> if (er) return cb(er); <del> render({ <del> lexed: lexed, <del> filename: opts.filename, <del> template: template, <del> nodeVersion: opts.nodeVersion, <del> }, cb); <add> render(lexed, filename, template, nodeVersion, cb); <ide> }); <ide> } <ide> } <ide> function toID(filename) { <ide> .replace(/-+/g, '-'); <ide> } <ide> <del>/** <del> * opts: lexed, filename, template, nodeVersion. <del> */ <del>function render(opts, cb) { <del> var lexed = opts.lexed; <del> var filename = opts.filename; <del> var template = opts.template; <add>function render(lexed, filename, template, nodeVersion, cb) { <add> if (typeof nodeVersion === 'function') { <add> cb = nodeVersion; <add> nodeVersion = null; <add> } <add> <add> nodeVersion = nodeVersion || process.version; <ide> <ide> // get the section <ide> var section = getSection(lexed); <ide> function render(opts, cb) { <ide> template = template.replace(/__ID__/g, id); <ide> template = template.replace(/__FILENAME__/g, filename); <ide> template = template.replace(/__SECTION__/g, section); <del> template = template.replace(/__VERSION__/g, opts.nodeVersion); <add> template = template.replace(/__VERSION__/g, nodeVersion); <ide> template = template.replace(/__TOC__/g, toc); <ide> template = template.replace( <ide> /__GTOC__/g,
2
Javascript
Javascript
update user state from server
3823ed19bcb03fc0c86d04c32e6241a5b01f685d
<ide><path>api-server/server/boot/settings.js <ide> const updatePrivacyTerms = (req, res, next) => { <ide> <ide> function updateUserFlag(req, res, next) { <ide> const { user, body: update } = req; <del> user.updateAttributes(update, createStandardHandler(req, res, next)); <add> return user.updateAttributes(update, createStandardHandler(req, res, next)); <ide> } <ide><path>client/src/components/settings/Internet.js <ide> const propTypes = { <ide> class InternetSettings extends Component { <ide> constructor(props) { <ide> super(props); <del> <ide> const { <ide> githubProfile = '', <ide> linkedin = '', <ide> class InternetSettings extends Component { <ide> }; <ide> } <ide> <add> componentDidUpdate() { <add> const { <add> githubProfile = '', <add> linkedin = '', <add> twitter = '', <add> website = '' <add> } = this.props; <add> <add> const { originalValues } = this.state; <add> <add> if ( <add> githubProfile !== originalValues.githubProfile || <add> linkedin !== originalValues.linkedin || <add> twitter !== originalValues.twitter || <add> website !== originalValues.website <add> ) { <add> /* eslint-disable-next-line react/no-did-update-set-state */ <add> return this.setState({ <add> originalValues: { githubProfile, linkedin, twitter, website } <add> }); <add> } <add> return null; <add> } <add> <ide> getValidationStateFor(maybeURl = '') { <ide> if (!maybeURl || !maybeUrlRE.test(maybeURl)) { <ide> return { <ide> class InternetSettings extends Component { <ide> }; <ide> <ide> isFormValid = () => { <del> const { formValues } = this.state; <add> const { formValues, originalValues } = this.state; <add> const valueReducer = obj => { <add> return Object.values(obj).reduce( <add> (acc, cur) => (acc ? acc : cur !== ''), <add> false <add> ); <add> }; <add> <add> let formHasValues = valueReducer(formValues); <add> let OriginalHasValues = valueReducer(originalValues); <add> <add> // check if user had values but wants to delete them all <add> if (OriginalHasValues && !formHasValues) return true; <add> <ide> return Object.keys(formValues).reduce((bool, key) => { <ide> const maybeUrl = formValues[key]; <ide> return maybeUrl ? isURL(maybeUrl) : bool; <ide> class InternetSettings extends Component { <ide> handleSubmit = e => { <ide> e.preventDefault(); <ide> if (!this.isFormPristine() && this.isFormValid()) { <del> // Only submit the form if is has changed, and if it is valid <add> // // Only submit the form if is has changed, and if it is valid <ide> const { formValues } = this.state; <add> const isSocial = { <add> isGithub: !!formValues.githubProfile, <add> isLinkedIn: !!formValues.linkedin, <add> isTwitter: !!formValues.twitter, <add> isWebsite: !!formValues.website <add> }; <add> <ide> const { updateInternetSettings } = this.props; <del> return updateInternetSettings(formValues); <add> return updateInternetSettings({ ...isSocial, ...formValues }); <ide> } <ide> return null; <ide> }; <ide> class InternetSettings extends Component { <ide> ) : null} <ide> </FormGroup> <ide> <BlockSaveButton <del> disabled={ <del> this.isFormPristine() || <del> (!this.isFormPristine() && !this.isFormValid()) <del> } <add> disabled={this.isFormPristine() || !this.isFormValid()} <ide> /> <ide> </form> <ide> </FullWidthRow>
2
Go
Go
use generic handler for pprof profile lookups
a1b06933aff80763ec62a288d5178a4321be1baa
<ide><path>api/server/profiler.go <ide> func profilerSetup(mainRouter *mux.Router) { <ide> r.HandleFunc("/pprof/profile", pprof.Profile) <ide> r.HandleFunc("/pprof/symbol", pprof.Symbol) <ide> r.HandleFunc("/pprof/trace", pprof.Trace) <del> r.HandleFunc("/pprof/block", pprof.Handler("block").ServeHTTP) <del> r.HandleFunc("/pprof/heap", pprof.Handler("heap").ServeHTTP) <del> r.HandleFunc("/pprof/goroutine", pprof.Handler("goroutine").ServeHTTP) <del> r.HandleFunc("/pprof/threadcreate", pprof.Handler("threadcreate").ServeHTTP) <add> r.HandleFunc("/pprof/{name}", handlePprof) <add>} <add> <add>func handlePprof(w http.ResponseWriter, r *http.Request) { <add> var name string <add> if vars := mux.Vars(r); vars != nil { <add> name = vars["name"] <add> } <add> pprof.Handler(name).ServeHTTP(w, r) <ide> } <ide> <ide> // Replicated from expvar.go as not public.
1
Javascript
Javascript
require modules from react native as node modules.
151e1d7014ed63452218be496a6edf2355eb6a11
<ide><path>gulpfile.js <ide> var paths = { <ide> }, <ide> }; <ide> <del>var fbjsModuleMap = require('fbjs/module-map'); <del>var moduleMap = {}; <del>for (var key in fbjsModuleMap) { <del> moduleMap[key] = fbjsModuleMap[key]; <del>} <del>var whiteListNames = [ <del> 'deepDiffer', <del> 'deepFreezeAndThrowOnMutationInDev', <del> 'flattenStyle', <del> 'InitializeJavaScriptAppEngine', <del> 'RCTEventEmitter', <del> 'TextInputState', <del> 'UIManager', <del> 'View', <del>]; <del> <del>whiteListNames.forEach(function(name) { <del> moduleMap[name] = name; <del>}); <del> <del>moduleMap['object-assign'] = 'object-assign'; <add>var moduleMap = Object.assign( <add> {'object-assign': 'object-assign'}, <add> require('fbjs/module-map'), <add> { <add> deepDiffer: 'react-native/lib/deepDiffer', <add> deepFreezeAndThrowOnMutationInDev: 'react-native/lib/deepFreezeAndThrowOnMutationInDev', <add> flattenStyle: 'react-native/lib/flattenStyle', <add> InitializeJavaScriptAppEngine: 'react-native/lib/InitializeJavaScriptAppEngine', <add> RCTEventEmitter: 'react-native/lib/RCTEventEmitter', <add> TextInputState: 'react-native/lib/TextInputState', <add> UIManager: 'react-native/lib/UIManager', <add> UIManagerStatTracker: 'react-native/lib/UIManagerStatTracker', <add> View: 'react-native/lib/View', <add> } <add>); <ide> <ide> var babelOpts = { <ide> plugins: [
1
Javascript
Javascript
fix all the typos
551d6fc1dd983594831bdf8d716291ac4a86255c
<ide><path>packages/ember-application/lib/system/application-instance.js <ide> let ApplicationInstance = EmberObject.extend(RegistryProxy, ContainerProxy, { <ide> We would like new code (like the `visit` API) to stop making this assumption, <ide> so we created the asynchronous version above that returns a promise. But until <ide> we have migrated all the code, we would have to expose this method for use <del> *internall* in places where we need to boot an instance synchronously. <add> *internally* in places where we need to boot an instance synchronously. <ide> <ide> @private <ide> */ <ide> if (isEnabled('ember-application-visit')) { <ide> /** <ide> Provide a specific instance of jQuery. This is useful in conjunction with <ide> the `document` option, as it allows you to use a copy of `jQuery` that is <del> appropiately bound to the foriegn `document` (e.g. a jsdom). <add> appropriately bound to the foreign `document` (e.g. a jsdom). <ide> <ide> This is highly experimental and support very incomplete at the moment. <ide> <ide> if (isEnabled('ember-application-visit')) { <ide> and interactive features. Specifically: <ide> <ide> * It does not use `jQuery` to append the root view; the `rootElement` <del> (either specified as a subsequent option or on the applicatio itself) <add> (either specified as a subsequent option or on the application itself) <ide> must already be an `Element` in the given `document` (as opposed to a <ide> string selector). <ide> <ide><path>packages/ember-application/lib/system/application.js <ide> var Application = Namespace.extend(RegistryProxy, { <ide> <ide> /** <ide> Whether the application should be configured for the legacy "globals mode". <del> Under this mode, the Application object serves as a gobal namespace for all <add> Under this mode, the Application object serves as a global namespace for all <ide> classes. <ide> <ide> ```javascript <ide> var Application = Namespace.extend(RegistryProxy, { <ide> }); <ide> ``` <ide> <del> This flag also exposes other internal APIs that assumes the existance of <add> This flag also exposes other internal APIs that assumes the existence of <ide> a special "default instance", like `App.__container__.lookup(...)`. <ide> <ide> This option is currently not configurable, its value is derived from <ide> the `autoboot` flag – disabling `autoboot` also implies opting-out of <del> globals mode support, although they are ultimately orthgonal concerns. <add> globals mode support, although they are ultimately orthogonal concerns. <ide> <ide> Most of the global modes features are already deprecated in 1.x. The <del> existance of this flag is to untangle the globals mode code paths from <add> existence of this flag is to untangle the globals mode code paths from <ide> the autoboot code paths, so that these legacy features can be reviewed <ide> for removal separately. <ide> <ide> var Application = Namespace.extend(RegistryProxy, { <ide> Build the deprecated instance for legacy globals mode support. <ide> Called when creating and resetting the application. <ide> <del> This is orthgonal to autoboot: the deprecated instance needs to <add> This is orthogonal to autoboot: the deprecated instance needs to <ide> be created at Application construction (not boot) time to expose <ide> App.__container__ and the global Ember.View.views registry. If <ide> autoboot sees that this instance exists, it will continue booting <ide> var Application = Namespace.extend(RegistryProxy, { <ide> } <ide> ``` <ide> <del> Unfortunately, because we need to participate in the "synchronous" boot <del> process. While the code above would work fine on the initial boot (i.e. <del> DOM ready), when `App.reset()` is called, we need to boot a new instance <del> synchronously (see the documentation on `_bootSync()` for details). <add> Unfortunately, we cannot actually write this because we need to participate <add> in the "synchronous" boot process. While the code above would work fine on <add> the initial boot (i.e. DOM ready), when `App.reset()` is called, we need to <add> boot a new instance synchronously (see the documentation on `_bootSync()` <add> for details). <ide> <ide> Because of this restriction, the actual logic of this method is located <ide> inside `didBecomeReady()`. <ide> if (isEnabled('ember-application-visit')) { <ide> resolves with the instance when the initial routing and rendering is <ide> complete, or rejects with any error that occured during the boot process. <ide> <del> When `autoboot` is disabled, calling `visit` would first cause boot the <del> application. See the documentation on the `boot` method for details. <add> When `autoboot` is disabled, calling `visit` would first cause the <add> application to boot. See the documentation on the `boot` method for <add> details. <ide> <ide> This method also takes a hash of boot-time configuration options for <ide> customizing the instance's behavior. See the documentation on <ide> if (isEnabled('ember-application-visit')) { <ide> correctly today, largely due to Ember's jQuery dependency. <ide> <ide> Currently, there are three officially supported scenarios/configurations. <del> Usages outside of these scenarios are not guarenteed to work, but please <add> Usages outside of these scenarios are not guaranteed to work, but please <ide> feel free to file bug reports documenting your experience and any issues <ide> you encountered to help expand support. <ide>
2
PHP
PHP
fix issues with sparse arrays in themeview
354716cf60d3c375771fd14f9e79fab4725e0f41
<ide><path>lib/Cake/View/ThemeView.php <ide> protected function _paths($plugin = null, $cached = true) { <ide> $themePaths = array(); <ide> <ide> if (!empty($this->theme)) { <del> $count = count($paths); <del> for ($i = 0; $i < $count; $i++) { <del> if (strpos($paths[$i], DS . 'Plugin' . DS) === false <del> && strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) { <add> foreach ($paths as $path) { <add> if (strpos($path, DS . 'Plugin' . DS) === false <add> && strpos($path, DS . 'Cake' . DS . 'View') === false) { <ide> if ($plugin) { <del> $themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS; <add> $themePaths[] = $path . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS; <ide> } <del> $themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS; <add> $themePaths[] = $path . 'Themed'. DS . $this->theme . DS; <ide> } <ide> } <ide> $paths = array_merge($themePaths, $paths);
1
PHP
PHP
trigger deprecation warning
31e41d5c1d659d80054691a5f644047186f82109
<ide><path>src/Mailer/Email.php <ide> protected function _constructTransport($name) <ide> $className = App::className($config['className'], 'Mailer/Transport', 'Transport'); <ide> if (!$className) { <ide> $className = App::className($config['className'], 'Network/Email', 'Transport'); <add> trigger_error( <add> 'Transports in "Network/Email" are deprecated, use "Mailer/Transport" instead.', <add> E_USER_WARNING <add> ); <ide> } <ide> <ide> if (!$className) {
1
Python
Python
fix the typo
b92fe6f93c39b16f46fc04b5722cc3c0ec874422
<ide><path>numpy/core/_dtype.py <ide> def _is_packed(dtype): <ide> from a list of the field names and dtypes with no additional <ide> dtype parameters. <ide> <del> Duplicates the C `is_dtype_struct_simple_unaligned_layout` functio. <add> Duplicates the C `is_dtype_struct_simple_unaligned_layout` function. <ide> """ <ide> total_offset = 0 <ide> for name in dtype.names:
1
Java
Java
render top back and back button on search results
850ce649d467f8be274b0260441dab6f81b15e3f
<ide><path>ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java <ide> public class ReactRootView extends SizeMonitoringFrameLayout implements RootView <ide> private @Nullable String mJSModuleName; <ide> private @Nullable Bundle mLaunchOptions; <ide> private @Nullable KeyboardListener mKeyboardListener; <add> private @Nullable OnGenericMotionListener mOnGenericMotionListener; <ide> private boolean mWasMeasured = false; <ide> private boolean mAttachScheduled = false; <ide> private boolean mIsAttachedToWindow = false; <ide> public void onChildStartedNativeGesture(MotionEvent androidEvent) { <ide> EventDispatcher eventDispatcher = reactContext.getNativeModule(UIManagerModule.class) <ide> .getEventDispatcher(); <ide> mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, eventDispatcher); <add> // Hook for containers or fragments to get informed of the on touch events to perform actions. <add> if (mOnGenericMotionListener != null) { <add> mOnGenericMotionListener.onGenericMotion(this, androidEvent); <add> } <ide> } <ide> <ide> @Override <ide> public boolean onTouchEvent(MotionEvent ev) { <ide> return true; <ide> } <ide> <add> public void setOnGenericMotionListener(OnGenericMotionListener listener) { <add> mOnGenericMotionListener = listener; <add> } <add> <ide> private void dispatchJSTouchEvent(MotionEvent event) { <ide> if (mReactInstanceManager == null || !mIsAttachedToInstance || <ide> mReactInstanceManager.getCurrentReactContext() == null) {
1
PHP
PHP
fix bad merge
b53adbfb3a8f1a0f04665ccdf64566dc775f4058
<ide><path>tests/TestCase/Controller/Component/PaginatorComponentTest.php <ide> use Cake\Controller\Controller; <ide> use Cake\Core\Configure; <ide> use Cake\Datasource\ConnectionManager; <add>use Cake\Datasource\EntityInterface; <ide> use Cake\Datasource\Paginator; <ide> use Cake\Http\ServerRequest; <ide> use Cake\Network\Exception\NotFoundException;
1
Javascript
Javascript
add locale and test for tetum (tet) locale
5b76fb6492e830000ac3457e1e30de4cee7192a5
<ide><path>src/locale/tet.js <add>//! moment.js locale configuration <add>//! locale : Tetun Dili (East Timor) [tdt] <add>//! author : Joshua Brooks : https://github.com/joshbrooks <add>//! author : Onorio De J. Afonso : https://github.com/marobo <add> <add>import moment from '../moment'; <add> <add>export default moment.defineLocale('tet', { <add> months : 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juniu_Juliu_Augustu_Setembru_Outubru_Novembru_Dezembru'.split('_'), <add> monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Aug_Set_Out_Nov_Dez'.split('_'), <add> weekdays : 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sexta_Sabadu'.split('_'), <add> weekdaysShort : 'Dom_Seg_Ters_Kua_Kint_Sext_Sab'.split('_'), <add> weekdaysMin : 'Do_Seg_Te_Ku_Ki_Sex_Sa'.split('_'), <add> longDateFormat : { <add> LT : 'HH:mm', <add> LTS : 'HH:mm:ss', <add> L : 'DD/MM/YYYY', <add> LL : 'D MMMM YYYY', <add> LLL : 'D MMMM YYYY HH:mm', <add> LLLL : 'dddd, D MMMM YYYY HH:mm' <add> }, <add> calendar : { <add> sameDay: '[Ohin iha] LT', <add> nextDay: '[Aban iha] LT', <add> nextWeek: 'dddd [iha] LT', <add> lastDay: '[Horiseik iha] LT', <add> lastWeek: 'dddd [semana kotuk] [iha] LT', <add> sameElse: 'L' <add> }, <add> relativeTime : { <add> future : 'iha %s', <add> past : '%s liuba', <add> s : 'minutu balun', <add> m : 'minutu ida', <add> mm : 'minutus %d', <add> h : 'horas ida', <add> hh : 'horas %d', <add> d : 'loron ida', <add> dd : 'loron %d', <add> M : 'fulan ida', <add> MM : 'fulan %d', <add> y : 'tinan ida', <add> yy : 'tinan %d' <add> }, <add> ordinalParse: /\d{1,2}(st|nd|rd|th)/, <add> ordinal : function (number) { <add> var b = number % 10, <add> output = (~~(number % 100 / 10) === 1) ? 'th' : <add> (b === 1) ? 'st' : <add> (b === 2) ? 'nd' : <add> (b === 3) ? 'rd' : 'th'; <add> return number + output; <add> }, <add> week : { <add> dow : 1, // Monday is the first day of the week. <add> doy : 4 // The week that contains Jan 4th is the first week of the year. <add> } <add>}); <ide><path>src/test/locale/tet.js <add>import {localeModule, test} from '../qunit'; <add>import moment from '../../moment'; <add>localeModule('tet'); <add> <add>test('parse', function (assert) { <add> var tests = 'Janeiru Jan_Fevereiru Fev_Marsu Mar_Abril Abr_Maiu Mai_Juniu Jun_Juliu Jul_Augustu Aug_Setembru Set_Outubru Out_Novembru Nov_Dezembru Dez'.split('_'), i; <add> function equalTest(input, mmm, i) { <add> assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); <add> } <add> for (i = 0; i < 12; i++) { <add> tests[i] = tests[i].split(' '); <add> equalTest(tests[i][0], 'MMM', i); <add> equalTest(tests[i][1], 'MMM', i); <add> equalTest(tests[i][0], 'MMMM', i); <add> equalTest(tests[i][1], 'MMMM', i); <add> equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); <add> equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); <add> equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); <add> equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); <add> } <add>}); <add> <add>test('format', function (assert) { <add> var a = [ <add> ['dddd, MMMM Do YYYY, h:mm:ss a', 'Domingu, Fevereiru 14th 2010, 3:25:50 pm'], <add> ['ddd, hA', 'Dom, 3PM'], <add> ['M Mo MM MMMM MMM', '2 2nd 02 Fevereiru Fev'], <add> ['YYYY YY', '2010 10'], <add> ['D Do DD', '14 14th 14'], <add> ['d do dddd ddd dd', '0 0th Domingu Dom Do'], <add> ['DDD DDDo DDDD', '45 45th 045'], <add> ['w wo ww', '6 6th 06'], <add> ['h hh', '3 03'], <add> ['H HH', '15 15'], <add> ['m mm', '25 25'], <add> ['s ss', '50 50'], <add> ['a A', 'pm PM'], <add> ['[the] DDDo [day of the year]', 'the 45th day of the year'], <add> ['LTS', '15:25:50'], <add> ['L', '14/02/2010'], <add> ['LL', '14 Fevereiru 2010'], <add> ['LLL', '14 Fevereiru 2010 15:25'], <add> ['LLLL', 'Domingu, 14 Fevereiru 2010 15:25'], <add> ['l', '14/2/2010'], <add> ['ll', '14 Fev 2010'], <add> ['lll', '14 Fev 2010 15:25'], <add> ['llll', 'Dom, 14 Fev 2010 15:25'] <add> ], <add> b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), <add> i; <add> for (i = 0; i < a.length; i++) { <add> assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); <add> } <add>}); <add> <add>test('format ordinal', function (assert) { <add> assert.equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st'); <add> assert.equal(moment([2011, 0, 2]).format('DDDo'), '2nd', '2nd'); <add> assert.equal(moment([2011, 0, 3]).format('DDDo'), '3rd', '3rd'); <add> assert.equal(moment([2011, 0, 4]).format('DDDo'), '4th', '4th'); <add> assert.equal(moment([2011, 0, 5]).format('DDDo'), '5th', '5th'); <add> assert.equal(moment([2011, 0, 6]).format('DDDo'), '6th', '6th'); <add> assert.equal(moment([2011, 0, 7]).format('DDDo'), '7th', '7th'); <add> assert.equal(moment([2011, 0, 8]).format('DDDo'), '8th', '8th'); <add> assert.equal(moment([2011, 0, 9]).format('DDDo'), '9th', '9th'); <add> assert.equal(moment([2011, 0, 10]).format('DDDo'), '10th', '10th'); <add> <add> assert.equal(moment([2011, 0, 11]).format('DDDo'), '11th', '11th'); <add> assert.equal(moment([2011, 0, 12]).format('DDDo'), '12th', '12th'); <add> assert.equal(moment([2011, 0, 13]).format('DDDo'), '13th', '13th'); <add> assert.equal(moment([2011, 0, 14]).format('DDDo'), '14th', '14th'); <add> assert.equal(moment([2011, 0, 15]).format('DDDo'), '15th', '15th'); <add> assert.equal(moment([2011, 0, 16]).format('DDDo'), '16th', '16th'); <add> assert.equal(moment([2011, 0, 17]).format('DDDo'), '17th', '17th'); <add> assert.equal(moment([2011, 0, 18]).format('DDDo'), '18th', '18th'); <add> assert.equal(moment([2011, 0, 19]).format('DDDo'), '19th', '19th'); <add> assert.equal(moment([2011, 0, 20]).format('DDDo'), '20th', '20th'); <add> <add> assert.equal(moment([2011, 0, 21]).format('DDDo'), '21st', '21st'); <add> assert.equal(moment([2011, 0, 22]).format('DDDo'), '22nd', '22nd'); <add> assert.equal(moment([2011, 0, 23]).format('DDDo'), '23rd', '23rd'); <add> assert.equal(moment([2011, 0, 24]).format('DDDo'), '24th', '24th'); <add> assert.equal(moment([2011, 0, 25]).format('DDDo'), '25th', '25th'); <add> assert.equal(moment([2011, 0, 26]).format('DDDo'), '26th', '26th'); <add> assert.equal(moment([2011, 0, 27]).format('DDDo'), '27th', '27th'); <add> assert.equal(moment([2011, 0, 28]).format('DDDo'), '28th', '28th'); <add> assert.equal(moment([2011, 0, 29]).format('DDDo'), '29th', '29th'); <add> assert.equal(moment([2011, 0, 30]).format('DDDo'), '30th', '30th'); <add> <add> assert.equal(moment([2011, 0, 31]).format('DDDo'), '31st', '31st'); <add>}); <add> <add>test('format month', function (assert) { <add> var expected = 'Janeiru Jan_Fevereiru Fev_Marsu Mar_Abril Abr_Maiu Mai_Juniu Jun_Juliu Jul_Augustu Aug_Setembru Set_Outubru Out_Novembru Nov_Dezembru Dez'.split('_'), i; <add> for (i = 0; i < expected.length; i++) { <add> assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); <add> } <add>}); <add> <add>test('format week', function (assert) { <add> var expected = 'Domingu Dom Do_Segunda Seg Seg_Tersa Ters Te_Kuarta Kua Ku_Kinta Kint Ki_Sexta Sext Sex_Sabadu Sab Sa'.split('_'), i; <add> for (i = 0; i < expected.length; i++) { <add> assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); <add> } <add>}); <add> <add>test('from', function (assert) { <add> var start = moment([2007, 1, 28]); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'minutu balun', '44 seconds = a few seconds'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'minutu ida', '45 seconds = a minute'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'minutu ida', '89 seconds = a minute'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), 'minutus 2', '90 seconds = 2 minutes'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), 'minutus 44', '44 minutes = 44 minutes'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'horas ida', '45 minutes = an hour'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'horas ida', '89 minutes = an hour'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), 'horas 2', '90 minutes = 2 hours'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), 'horas 5', '5 hours = 5 hours'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), 'horas 21', '21 hours = 21 hours'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'loron ida', '22 hours = a day'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'loron ida', '35 hours = a day'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), 'loron 2', '36 hours = 2 days'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'loron ida', '1 day = a day'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), 'loron 5', '5 days = 5 days'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), 'loron 25', '25 days = 25 days'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'fulan ida', '26 days = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'fulan ida', '30 days = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'fulan ida', '43 days = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), 'fulan 2', '46 days = 2 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), 'fulan 2', '75 days = 2 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), 'fulan 3', '76 days = 3 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'fulan ida', '1 month = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), 'fulan 5', '5 months = 5 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'tinan ida', '345 days = a year'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), 'tinan 2', '548 days = 2 years'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'tinan ida', '1 year = a year'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), 'tinan 5', '5 years = 5 years'); <add>}); <add> <add>test('suffix', function (assert) { <add> assert.equal(moment(30000).from(0), 'iha minutu balun', 'prefix'); <add> assert.equal(moment(0).from(30000), 'minutu balun liuba', 'suffix'); <add>}); <add> <add>test('now from now', function (assert) { <add> assert.equal(moment().fromNow(), 'minutu balun liuba', 'now from now should display as in the past'); <add>}); <add> <add>test('fromNow', function (assert) { <add> assert.equal(moment().add({s: 30}).fromNow(), 'iha minutu balun', 'in a few seconds'); <add> assert.equal(moment().add({d: 5}).fromNow(), 'iha loron 5', 'in 5 days'); <add>}); <add> <add>test('calendar day', function (assert) { <add> var a = moment().hours(12).minutes(0).seconds(0); <add> <add> assert.equal(moment(a).calendar(), 'Ohin iha 12:00', 'today at the same time'); <add> assert.equal(moment(a).add({m: 25}).calendar(), 'Ohin iha 12:25', 'Now plus 25 min'); <add> assert.equal(moment(a).add({h: 1}).calendar(), 'Ohin iha 13:00', 'Now plus 1 hour'); <add> assert.equal(moment(a).add({d: 1}).calendar(), 'Aban iha 12:00', 'tomorrow at the same time'); <add> assert.equal(moment(a).subtract({h: 1}).calendar(), 'Ohin iha 11:00', 'Now minus 1 hour'); <add> assert.equal(moment(a).subtract({d: 1}).calendar(), 'Horiseik iha 12:00', 'yesterday at the same time'); <add>}); <add> <add>test('calendar next week', function (assert) { <add> var i, m; <add> for (i = 2; i < 7; i++) { <add> m = moment().add({d: i}); <add> assert.equal(m.calendar(), m.format('dddd [iha] LT'), 'Today + ' + i + ' days current time'); <add> m.hours(0).minutes(0).seconds(0).milliseconds(0); <add> assert.equal(m.calendar(), m.format('dddd [iha] LT'), 'Today + ' + i + ' days beginning of day'); <add> m.hours(23).minutes(59).seconds(59).milliseconds(999); <add> assert.equal(m.calendar(), m.format('dddd [iha] LT'), 'Today + ' + i + ' days end of day'); <add> } <add>}); <add> <add>test('calendar last week', function (assert) { <add> var i, m; <add> <add> for (i = 2; i < 7; i++) { <add> m = moment().subtract({d: i}); <add> assert.equal(m.calendar(), m.format('dddd [semana kotuk] [iha] LT'), 'Today - ' + i + ' days current time'); <add> m.hours(0).minutes(0).seconds(0).milliseconds(0); <add> assert.equal(m.calendar(), m.format('dddd [semana kotuk] [iha] LT'), 'Today - ' + i + ' days beginning of day'); <add> m.hours(23).minutes(59).seconds(59).milliseconds(999); <add> assert.equal(m.calendar(), m.format('dddd [semana kotuk] [iha] LT'), 'Today - ' + i + ' days end of day'); <add> } <add>}); <add> <add>test('calendar all else', function (assert) { <add> var weeksAgo = moment().subtract({w: 1}), <add> weeksFromNow = moment().add({w: 1}); <add> <add> assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); <add> assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); <add> <add> weeksAgo = moment().subtract({w: 2}); <add> weeksFromNow = moment().add({w: 2}); <add> <add> assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); <add> assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); <add>}); <add> <add>test('weeks year starting sunday formatted', function (assert) { <add> assert.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52nd', 'Jan 1 2012 should be week 52'); <add> assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1st', 'Jan 2 2012 should be week 1'); <add> assert.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1st', 'Jan 8 2012 should be week 1'); <add> assert.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2nd', 'Jan 9 2012 should be week 2'); <add> assert.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2nd', 'Jan 15 2012 should be week 2'); <add>}); <add>
2
PHP
PHP
add failing test for handling head request
811f52cbfe22f0da99ed6340486468518f2e1159
<ide><path>tests/Routing/RoutingRouteTest.php <ide> public function testBasicDispatchingOfRoutes() <ide> $this->assertEquals('fred25', $router->dispatch(Request::create('fred', 'GET'))->getContent()); <ide> $this->assertEquals('fred30', $router->dispatch(Request::create('fred/30', 'GET'))->getContent()); <ide> $this->assertTrue($router->currentRouteNamed('foo')); <add> <add> $router = $this->getRouter(); <add> $router->get('foo/bar', function() { return 'hello'; }); <add> $this->assertEquals('', $router->dispatch(Request::create('foo/bar', 'HEAD'))->getContent()); <add> <add> $router = $this->getRouter(); <add> $router->any('foo/bar', function() { return 'hello'; }); <add> $this->assertEquals('', $router->dispatch(Request::create('foo/bar', 'HEAD'))->getContent()); <ide> } <ide> <ide> <ide> public function find($value) { return strtoupper($value); } <ide> <ide> class RouteModelBindingNullStub { <ide> public function find($value) {} <del>} <ide>\ No newline at end of file <add>}
1
Javascript
Javascript
calculate array lengths once at start of loop
907b8c1675865ac38dd055f3f304272e68b233d0
<ide><path>src/ng/parse.js <ide> Parser.prototype = { <ide> <ide> return extend(function $parseArrayLiteral(self, locals) { <ide> var array = []; <del> for (var i = 0; i < elementFns.length; i++) { <add> for (var i = 0, ii = elementFns.length; i < ii; i++) { <ide> array.push(elementFns[i](self, locals)); <ide> } <ide> return array; <ide> Parser.prototype = { <ide> <ide> return extend(function $parseObjectLiteral(self, locals) { <ide> var object = {}; <del> for (var i = 0; i < keyValues.length; i++) { <add> for (var i = 0, ii = keyValues.length; i < ii; i++) { <ide> var keyValue = keyValues[i]; <ide> object[keyValue.key] = keyValue.value(self, locals); <ide> }
1
Javascript
Javascript
publish dist bower.json & co to s3
bfe959e72879f38adde992a3e46ea4cd6fabef3d
<ide><path>config/s3ProjectConfig.js <ide> function fileMap(revision,tag,date) { <ide> "ember.min.js": fileObject("ember.min", ".js", "text/javascript", revision, tag, date), <ide> "ember.prod.js": fileObject("ember.prod", ".js", "text/javascript", revision, tag, date), <ide> "../docs/data.json": fileObject("ember-docs", ".json", "application/json", revision, tag, date), <del> "ember-tests/index.html": fileObject("ember-tests-index", ".html", "text/html", revision, tag, date) <add> "ember-tests/index.html": fileObject("ember-tests-index", ".json", "application/json", revision, tag, date), <add> "bower.json": fileObject("bower", ".json", "application/json", revision, tag, date), <add> "component.json": fileObject("component", ".json", "application/json", revision, tag, date), <add> "composer.json": fileObject("composer", ".json", "application/json", revision, tag, date), <add> "package.json": fileObject("package", ".json", "application/json", revision, tag, date), <ide> }; <ide> }; <ide> <ide> function fileObject(baseName, extension, contentType, currentRevision, tag, date) { <ide> var fullName = "/" + baseName + extension; <ide> var obj = { <ide> contentType: contentType, <del> destinations: { <del> canary: [ <del> "latest" + fullName, <del> "canary" + fullName, <del> "canary/daily/" + date + fullName, <del> "canary/shas/" + currentRevision + fullName <del> ], <del> release: [ <del> "stable" + fullName, <del> "release" + fullName, <del> "release/daily/" + date + fullName, <del> "release/shas/" + currentRevision + fullName <del> ], <del> 'release-1-13': [ <del> "release-1-13" + fullName, <del> "release-1-13/daily/" + date + fullName, <del> "release-1-13/shas/" + currentRevision + fullName <del> ], <del> beta: [ <del> "beta" + fullName, <del> "beta/daily/" + date + fullName, <del> "beta/shas/" + currentRevision + fullName <del> ], <del> wildcard: [] <del> } <del> }; <add> destinations: { <add> canary: [ <add> "latest" + fullName, <add> "canary" + fullName, <add> "canary/daily/" + date + fullName, <add> "canary/shas/" + currentRevision + fullName <add> ], <add> release: [ <add> "stable" + fullName, <add> "release" + fullName, <add> "release/daily/" + date + fullName, <add> "release/shas/" + currentRevision + fullName <add> ], <add> 'release-1-13': [ <add> "release-1-13" + fullName, <add> "release-1-13/daily/" + date + fullName, <add> "release-1-13/shas/" + currentRevision + fullName <add> ], <add> beta: [ <add> "beta" + fullName, <add> "beta/daily/" + date + fullName, <add> "beta/shas/" + currentRevision + fullName <add> ], <add> wildcard: [] <add> } <add> }; <ide> <del> if (tag) { <del> for (var key in obj.destinations) { <del> obj.destinations[key].push("tags/" + tag + fullName); <del> } <del> } <add> if (tag) { <add> for (var key in obj.destinations) { <add> obj.destinations[key].push("tags/" + tag + fullName); <add> } <add> } <ide> <del> return obj; <add> return obj; <ide> } <ide> <ide> module.exports = fileMap;
1
Go
Go
remove some intermediate variables
a4bfd9788ff96e2e8a8b65d43f1b4cf0f621a734
<ide><path>volume/local/local.go <ide> type activeMount struct { <ide> // is the base path that the Root instance uses to store its <ide> // volumes. The base path is created here if it does not exist. <ide> func New(scope string, rootIdentity idtools.Identity) (*Root, error) { <del> rootDirectory := filepath.Join(scope, volumesPathName) <del> <del> if err := idtools.MkdirAllAndChown(rootDirectory, 0701, idtools.CurrentIdentity()); err != nil { <del> return nil, err <del> } <del> <ide> r := &Root{ <del> path: rootDirectory, <add> path: filepath.Join(scope, volumesPathName), <ide> volumes: make(map[string]*localVolume), <ide> rootIdentity: rootIdentity, <ide> } <ide> <del> dirs, err := os.ReadDir(rootDirectory) <add> if err := idtools.MkdirAllAndChown(r.path, 0701, idtools.CurrentIdentity()); err != nil { <add> return nil, err <add> } <add> <add> dirs, err := os.ReadDir(r.path) <ide> if err != nil { <ide> return nil, err <ide> } <ide> <del> if r.quotaCtl, err = quota.NewControl(rootDirectory); err != nil { <del> logrus.Debugf("No quota support for local volumes in %s: %v", rootDirectory, err) <add> if r.quotaCtl, err = quota.NewControl(r.path); err != nil { <add> logrus.Debugf("No quota support for local volumes in %s: %v", r.path, err) <ide> } <ide> <ide> for _, d := range dirs { <ide> func New(scope string, rootIdentity idtools.Identity) (*Root, error) { <ide> quotaCtl: r.quotaCtl, <ide> } <ide> r.volumes[name] = v <del> optsFilePath := filepath.Join(rootDirectory, name, "opts.json") <del> if b, err := os.ReadFile(optsFilePath); err == nil { <add> if b, err := os.ReadFile(filepath.Join(r.path, name, "opts.json")); err == nil { <ide> opts := optsConfig{} <ide> if err := json.Unmarshal(b, &opts); err != nil { <ide> return nil, errors.Wrapf(err, "error while unmarshaling volume options for volume: %s", name)
1
Text
Text
modernize code examples in the cluster.md
e03ee719e6e760777b237861bf0b7835432af8bb
<ide><path>doc/api/cluster.md <ide> const http = require('http'); <ide> const numCPUs = require('os').cpus().length; <ide> <ide> if (cluster.isMaster) { <add> console.log(`Master ${process.pid} is running`); <add> <ide> // Fork workers. <del> for (var i = 0; i < numCPUs; i++) { <add> for (let i = 0; i < numCPUs; i++) { <ide> cluster.fork(); <ide> } <ide> <ide> if (cluster.isMaster) { <ide> res.writeHead(200); <ide> res.end('hello world\n'); <ide> }).listen(8000); <add> <add> console.log(`Worker ${process.pid} started`); <ide> } <ide> ``` <ide> <ide> Running Node.js will now share port 8000 between the workers: <ide> <ide> ```txt <del>$ NODE_DEBUG=cluster node server.js <del>23521,Master Worker 23524 online <del>23521,Master Worker 23526 online <del>23521,Master Worker 23523 online <del>23521,Master Worker 23528 online <add>$ node server.js <add>Master 3596 is running <add>Worker 4324 started <add>Worker 4520 started <add>Worker 6056 started <add>Worker 5644 started <ide> ``` <ide> <ide> Please note that on Windows, it is not yet possible to set up a named pipe <ide> const http = require('http'); <ide> if (cluster.isMaster) { <ide> <ide> // Keep track of http requests <del> var numReqs = 0; <add> let numReqs = 0; <ide> setInterval(() => { <del> console.log('numReqs =', numReqs); <add> console.log(`numReqs = ${numReqs}`); <ide> }, 1000); <ide> <ide> // Count requests <ide> function messageHandler(msg) { <del> if (msg.cmd && msg.cmd == 'notifyRequest') { <add> if (msg.cmd && msg.cmd === 'notifyRequest') { <ide> numReqs += 1; <ide> } <ide> } <ide> <ide> // Start workers and listen for messages containing notifyRequest <ide> const numCPUs = require('os').cpus().length; <del> for (var i = 0; i < numCPUs; i++) { <add> for (let i = 0; i < numCPUs; i++) { <ide> cluster.fork(); <ide> } <ide> <del> Object.keys(cluster.workers).forEach((id) => { <add> for (const id in cluster.workers) { <ide> cluster.workers[id].on('message', messageHandler); <del> }); <add> } <ide> <ide> } else { <ide> <ide> the `'disconnect'` event has not been emitted after some time. <ide> <ide> ```js <ide> if (cluster.isMaster) { <del> var worker = cluster.fork(); <del> var timeout; <add> const worker = cluster.fork(); <add> let timeout; <ide> <ide> worker.on('listening', (address) => { <ide> worker.send('shutdown'); <ide> if (cluster.isMaster) { <ide> <ide> } else if (cluster.isWorker) { <ide> const net = require('net'); <del> var server = net.createServer((socket) => { <add> const server = net.createServer((socket) => { <ide> // connections never end <ide> }); <ide> <ide> This example will echo back all messages from the master: <ide> <ide> ```js <ide> if (cluster.isMaster) { <del> var worker = cluster.fork(); <add> const worker = cluster.fork(); <ide> worker.send('hi there'); <ide> <ide> } else if (cluster.isWorker) { <ide> When a new worker is forked the cluster module will emit a `'fork'` event. <ide> This can be used to log worker activity, and create your own timeout. <ide> <ide> ```js <del>var timeouts = []; <add>const timeouts = []; <ide> function errorMsg() { <ide> console.error('Something must be wrong with the connection ...'); <ide> } <ide> If you need to support older versions and don't need the worker object, <ide> you can work around the discrepancy by checking the number of arguments: <ide> <ide> ```js <del>cluster.on('message', function(worker, message, handle) { <add>cluster.on('message', (worker, message, handle) => { <ide> if (arguments.length === 2) { <ide> handle = message; <ide> message = worker; <ide> before last `'disconnect'` or `'exit'` event is emitted. <ide> ```js <ide> // Go through all workers <ide> function eachWorker(callback) { <del> for (var id in cluster.workers) { <add> for (const id in cluster.workers) { <ide> callback(cluster.workers[id]); <ide> } <ide> } <ide> the worker's unique id is the easiest way to find the worker. <ide> <ide> ```js <ide> socket.on('data', (id) => { <del> var worker = cluster.workers[id]; <add> const worker = cluster.workers[id]; <ide> }); <ide> ``` <ide>
1
Ruby
Ruby
fix the build
47be2f101cf133d6d1b9527b8764306d6ddcbf2c
<ide><path>actionpack/test/dispatch/mapper_test.rb <ide> module ActionDispatch <ide> module Routing <ide> class MapperTest < ActiveSupport::TestCase <ide> class FakeSet <del> attr_reader :routes <add> attr_reader :routes, :draw_paths <ide> alias :set :routes <ide> <ide> def initialize <ide> @routes = [] <add> @draw_paths = [] <ide> end <ide> <ide> def resources_path_names <ide><path>railties/lib/rails/engine.rb <ide> def config <ide> # <ide> # Blog::Engine.load_seed <ide> def load_seed <del> seed_file = paths["db/seeds"].existent.first <add> seed_file = paths["db/seeds.rb"].existent.first <ide> load(seed_file) if seed_file <ide> end <ide>
2
Javascript
Javascript
clarify input and ngmodel behavior
036871df5ea9777b15dc6f7ddb03bdafa9c1f122
<ide><path>src/ng/directive/input.js <ide> var inputType = { <ide> * @description <ide> * Standard HTML text input with angular data binding, inherited by most of the `input` elements. <ide> * <del> * *NOTE* Not every feature offered is available for all input types. <ide> * <ide> * @param {string} ngModel Assignable angular expression to data-bind to. <ide> * @param {string=} name Property name of the form under which the control is published. <ide> var inputType = { <ide> * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 <ide> * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many <ide> * modern browsers do not yet support this input type, it is important to provide cues to users on the <del> * expected input format via a placeholder or label. The model must always be a Date object. <add> * expected input format via a placeholder or label. <add> * <add> * The model must always be a Date object, otherwise Angular will throw an error. <add> * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. <ide> * <ide> * The timezone to be used to read/write the `Date` instance in the model can be defined using <ide> * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. <ide> var inputType = { <ide> * @description <ide> * Input with datetime validation and transformation. In browsers that do not yet support <ide> * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 <del> * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. The model must be a Date object. <add> * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. <add> * <add> * The model must always be a Date object, otherwise Angular will throw an error. <add> * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. <ide> * <ide> * The timezone to be used to read/write the `Date` instance in the model can be defined using <ide> * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. <ide> var inputType = { <ide> * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a <ide> * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. <ide> * <add> * The model must always be a Date object, otherwise Angular will throw an error. <add> * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. <add> * <ide> * The timezone to be used to read/write the `Date` instance in the model can be defined using <ide> * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. <ide> * <ide> var inputType = { <ide> * @description <ide> * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support <ide> * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 <del> * week format (yyyy-W##), for example: `2013-W02`. The model must always be a Date object. <add> * week format (yyyy-W##), for example: `2013-W02`. <add> * <add> * The model must always be a Date object, otherwise Angular will throw an error. <add> * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. <ide> * <ide> * The timezone to be used to read/write the `Date` instance in the model can be defined using <ide> * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. <ide> var inputType = { <ide> * @description <ide> * Input with month validation and transformation. In browsers that do not yet support <ide> * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 <del> * month format (yyyy-MM), for example: `2009-01`. The model must always be a Date object. In the event the model is <del> * not set to the first of the month, the first of that model's month is assumed. <add> * month format (yyyy-MM), for example: `2009-01`. <add> * <add> * The model must always be a Date object, otherwise Angular will throw an error. <add> * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. <add> * If the model is not set to the first of the month, the next view to model update will set it <add> * to the first of the month. <ide> * <ide> * The timezone to be used to read/write the `Date` instance in the model can be defined using <ide> * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. <ide> var inputType = { <ide> * Text input with number validation and transformation. Sets the `number` validation <ide> * error if not a valid number. <ide> * <add> * The model must always be a number, otherwise Angular will throw an error. <add> * <ide> * @param {string} ngModel Assignable angular expression to data-bind to. <ide> * @param {string=} name Property name of the form under which the control is published. <ide> * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. <ide> function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filt <ide> * @restrict E <ide> * <ide> * @description <del> * HTML input element control with angular data-binding. Input control follows HTML5 input types <del> * and polyfills the HTML5 validation behavior for older browsers. <add> * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding, <add> * input state control, and validation. <add> * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers. <ide> * <del> * *NOTE* Not every feature offered is available for all input types. <add> * <div class="alert alert-warning"> <add> * **Note:** Not every feature offered is available for all input types. <add> * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`. <add> * </div> <ide> * <ide> * @param {string} ngModel Assignable angular expression to data-bind to. <ide> * @param {string=} name Property name of the form under which the control is published. <ide> var VALID_CLASS = 'ng-valid', <ide> * is expected to return a promise when it is run during the model validation process. Once the promise <ide> * is delivered then the validation status will be set to true when fulfilled and false when rejected. <ide> * When the asynchronous validators are triggered, each of the validators will run in parallel and the model <del> * value will only be updated once all validators have been fulfilled. Also, keep in mind that all <del> * asynchronous validators will only run once all synchronous validators have passed. <add> * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator <add> * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators <add> * will only run once all synchronous validators have passed. <ide> * <ide> * Please note that if $http is used then it is important that the server returns a success HTTP response code <ide> * in order to fulfill the validation and a status level of `4xx` in order to reject the validation. <ide> var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ <ide> * @name ngModel.NgModelController#$setValidity <ide> * <ide> * @description <del> * Change the validity state, and notifies the form. <add> * Change the validity state, and notify the form. <ide> * <ide> * This method can be called within $parsers/$formatters or a custom validation implementation. <ide> * However, in most cases it should be sufficient to use the `ngModel.$validators` and <ide> var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ <ide> * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` <ide> * class and can be bound to as `{{someForm.someControl.$error.myError}}` . <ide> * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined), <del> * or skipped (null). <add> * or skipped (null). Pending is used for unfulfilled `$asyncValidators`. <add> * Skipped is used by Angular when validators do not run because of parse errors and <add> * when `$asyncValidators` do not run because any of the `$validators` failed. <ide> */ <ide> addSetValidityMethod({ <ide> ctrl: this,
1
Python
Python
write binary file during training
8a693c2605df8ebf2c5521e2f419bc7d57ebb950
<ide><path>spacy/cli/train.py <ide> def train(cmd, lang, output_dir, train_data, dev_data, n_iter=20, n_sents=0, <ide> with nlp.use_params(optimizer.averages): <ide> with (output_path / ('model%d.pickle' % i)).open('wb') as file_: <ide> dill.dump(nlp, file_, -1) <del> with (output_path / ('model%d.pickle' % i)).open('rb') as file_: <del> nlp_loaded = dill.load(file_) <add> with (output_path / ('model%d.bin' % i)).open('wb') as file_: <add> file_.write(nlp.to_bytes()) <add> with (output_path / ('model%d.bin' % i)).open('rb') as file_: <add> nlp_loaded = lang_class(pipeline=pipeline) <add> nlp_loaded.from_bytes(file_.read()) <ide> scorer = nlp_loaded.evaluate(corpus.dev_docs(nlp_loaded, gold_preproc=False)) <ide> print_progress(i, losses, scorer.scores) <ide> finally:
1
Java
Java
fix exception message
591429e538d1e59b47dff4c760cfd8763c57ebd7
<ide><path>spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java <ide> protected void processScheduled(Scheduled scheduled, Method method, Object bean) <ide> } <ide> catch (NumberFormatException ex) { <ide> throw new IllegalArgumentException( <del> "Invalid initialDelayString value \"" + initialDelayString + "\" - cannot parse into integer"); <add> "Invalid initialDelayString value \"" + initialDelayString + "\" - cannot parse into long"); <ide> } <ide> } <ide> }
1
Text
Text
fix the issue link
1054ea559ca1c27dcd9e187cf44aba377a947d3d
<ide><path>docs/topics/release-notes.md <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> [gh3321]: https://github.com/tomchristie/django-rest-framework/issues/3321 <ide> <ide> <!-- 3.2.4 --> <del>[gh3314]: https://github.com/tomchristie/django-rest-framework/issues/@3314 <del>[gh3323]: https://github.com/tomchristie/django-rest-framework/issues/@3323 <del>[gh3324]: https://github.com/tomchristie/django-rest-framework/issues/@3324 <del>[gh3359]: https://github.com/tomchristie/django-rest-framework/issues/@3359 <del>[gh3361]: https://github.com/tomchristie/django-rest-framework/issues/@3361 <del>[gh3364]: https://github.com/tomchristie/django-rest-framework/issues/@3364 <add>[gh3314]: https://github.com/tomchristie/django-rest-framework/issues/3314 <add>[gh3323]: https://github.com/tomchristie/django-rest-framework/issues/3323 <add>[gh3324]: https://github.com/tomchristie/django-rest-framework/issues/3324 <add>[gh3359]: https://github.com/tomchristie/django-rest-framework/issues/3359 <add>[gh3361]: https://github.com/tomchristie/django-rest-framework/issues/3361 <add>[gh3364]: https://github.com/tomchristie/django-rest-framework/issues/3364
1
Ruby
Ruby
add cpu family armv8.3-a
559d0a91a28b40e6e2c6d2dcf00b14cfdf7989d4
<ide><path>Library/Homebrew/extend/os/mac/hardware/cpu.rb <ide> def type <ide> end <ide> <ide> def family <del> return :dunno if arm? <del> <ide> case sysctl_int("hw.cpufamily") <ide> when 0x73d67300 # Yonah: Core Solo/Duo <ide> :core <ide> def family <ide> :kabylake <ide> when 0x38435547 # Ice Lake <ide> :icelake <add> when 0x07d34b9f # ARMv8.3-A (Vortex, Tempest) <add> :arm_vortex_tempest <ide> else <ide> :dunno <ide> end
1
PHP
PHP
improve doc block to be more precise
eb337dcffe59bc0d410c4f70eb9d1550a9647326
<ide><path>src/ORM/Table.php <ide> protected function _update($entity, $data) <ide> * any one of the records fails to save due to failed validation or database <ide> * error. <ide> * <del> * @param array|\Cake\ORM\ResultSet $entities Entities to save. <add> * @param \Cake\Datasource\EntityInterface[]|\Cake\ORM\ResultSet $entities Entities to save. <ide> * @param array|\ArrayAccess $options Options used when calling Table::save() for each entity. <del> * @return bool|array|\Cake\ORM\ResultSet False on failure, entities list on success. <add> * @return bool|\Cake\Datasource\EntityInterface[]|\Cake\ORM\ResultSet False on failure, entities list on success. <ide> */ <ide> public function saveMany($entities, $options = []) <ide> {
1
Javascript
Javascript
move semicolon to a later location in bundle #830
ffd9cce20ac7b2cc76cb0fbeb4b9815e6f31b5a1
<ide><path>lib/ChunkTemplate.js <ide> MIT License http://www.opensource.org/licenses/mit-license.php <ide> Author Tobias Koppers @sokra <ide> */ <add>var ConcatSource = require("webpack-core/lib/ConcatSource"); <ide> var Template = require("./Template"); <ide> <ide> function ChunkTemplate(outputOptions) { <ide> ChunkTemplate.prototype.render = function(chunk, moduleTemplate, dependencyTempl <ide> source = this.applyPluginsWaterfall("render-with-entry", source, chunk); <ide> } <ide> chunk.rendered = true; <del> return source; <add> return new ConcatSource(source, ";"); <ide> }; <ide> <ide> ChunkTemplate.prototype.updateHash = function(hash) { <ide><path>lib/MainTemplate.js <ide> function MainTemplate(outputOptions) { <ide> source.add("/******/ ("); <ide> var modules = this.renderChunkModules(chunk, moduleTemplate, dependencyTemplates, "/******/ "); <ide> source.add(this.applyPluginsWaterfall("modules", modules, chunk, hash, moduleTemplate, dependencyTemplates)); <del> source.add(");"); <add> source.add(")"); <ide> return source; <ide> }); <ide> this.plugin("local-vars", function(source, chunk, hash) { <ide> MainTemplate.prototype.render = function(hash, chunk, moduleTemplate, dependency <ide> } <ide> if(!source) throw new Error("Compiler error: MainTemplate plugin 'render' should return something"); <ide> chunk.rendered = true; <del> return source; <add> return new ConcatSource(source, ";"); <ide> }; <ide> <ide> MainTemplate.prototype.renderRequireFunctionForModule = function(hash, chunk, varModuleId) { <ide><path>test/ConfigTestCases.test.js <ide> describe("ConfigTestCases", function() { <ide> // give a free pass to compilation that generated an error <ide> if(!jsonStats.errors.length && filesCount !== optionsArr.length) return done(new Error("Should have found at least one bundle file per webpack config")); <ide> if(exportedTests < filesCount) return done(new Error("No tests exported by test case")); <del> done(); <add> process.nextTick(done); <ide> }); <ide> }); <ide> }); <ide><path>test/configCases/library/b/index.js <add>it("should run", function() { <add> <add>}); <add> <add>it("should have exported", function(done) { <add> setTimeout(function() { <add> exported.object.should.be.eql(module.exports.object); <add> exported.second.should.be.eql(module.exports.second); <add> done(); <add> }, 1); <add>}); <add> <add>module.exports = { <add> object: {ok: 1}, <add> second: {ok: 2} <add>}; <add> <add>var exported = {}; <add> <add>process.nextTick(function() { <add> exported.object = global.object; <add> exported.second = global.second; <add> delete global.object; <add> delete global.second; <add>}); <ide><path>test/configCases/library/b/webpack.config.js <add>module.exports = { <add> output: { <add> libraryTarget: "global" <add> } <add>}; <ide>\ No newline at end of file
5
PHP
PHP
fix urlencode prob
3a62036a9cfa544205dfee84b398066e91c1cd0a
<ide><path>laravel/html.php <ide> public static function decode($value) <ide> */ <ide> public static function script($url, $attributes = array()) <ide> { <del> $url = urlencode(URL::to_asset($url)); <add> $url = URL::to_asset($url); <ide> <ide> return '<script src="'.$url.'"'.static::attributes($attributes).'></script>'.PHP_EOL; <ide> } <ide> public static function style($url, $attributes = array()) <ide> <ide> $attributes = $attributes + $defaults; <ide> <del> $url = urlencode(URL::to_asset($url)); <add> $url = URL::to_asset($url); <ide> <ide> return '<link href="'.$url.'"'.static::attributes($attributes).'>'.PHP_EOL; <ide> } <ide> public static function span($value, $attributes = array()) <ide> */ <ide> public static function link($url, $title, $attributes = array(), $https = false) <ide> { <del> $url = urlencode(URL::to($url, $https)); <add> $url = URL::to($url, $https); <ide> <ide> return '<a href="'.$url.'"'.static::attributes($attributes).'>'.static::entities($title).'</a>'; <ide> } <ide> public static function link_to_secure($url, $title, $attributes = array()) <ide> */ <ide> public static function link_to_asset($url, $title, $attributes = array(), $https = null) <ide> { <del> $url = urlencode(URL::to_asset($url, $https)); <add> $url = URL::to_asset($url, $https); <ide> <ide> return '<a href="'.$url.'"'.static::attributes($attributes).'>'.static::entities($title).'</a>'; <ide> } <ide> public static function image($url, $alt = '', $attributes = array()) <ide> { <ide> $attributes['alt'] = $alt; <ide> <del> return '<img src="'.urlencode(URL::to_asset($url)).'"'.static::attributes($attributes).'>'; <add> return '<img src="'.URL::to_asset($url).'"'.static::attributes($attributes).'>'; <ide> } <ide> <ide> /**
1
Go
Go
replace loop with single append
64238fef8c7b739a2ae5648386cf594eb3a162e5
<ide><path>api/server/router/network/network_routes.go <ide> func (n *networkRouter) getNetworksList(ctx context.Context, w http.ResponseWrit <ide> list := []types.NetworkResource{} <ide> <ide> if nr, err := n.clusterProvider.GetNetworks(); err == nil { <del> for _, nw := range nr { <del> list = append(list, nw) <del> } <add> list = append(list, nr...) <ide> } <ide> <ide> // Combine the network list returned by Docker daemon if it is not already <ide><path>api/server/server.go <ide> func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc { <ide> // InitRouter initializes the list of routers for the server. <ide> // This method also enables the Go profiler if enableProfiler is true. <ide> func (s *Server) InitRouter(enableProfiler bool, routers ...router.Router) { <del> for _, r := range routers { <del> s.routers = append(s.routers, r) <del> } <add> s.routers = append(s.routers, routers...) <ide> <ide> m := s.createMux() <ide> if enableProfiler { <ide><path>daemon/container_operations_unix.go <ide> func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]s <ide> child.Config.ExposedPorts, <ide> ) <ide> <del> for _, envVar := range link.ToEnv() { <del> env = append(env, envVar) <del> } <add> env = append(env, link.ToEnv()...) <ide> } <ide> <ide> return env, nil <ide><path>daemon/graphdriver/devmapper/deviceset.go <ide> func (devices *DeviceSet) createFilesystem(info *devInfo) (err error) { <ide> devname := info.DevName() <ide> <ide> args := []string{} <del> for _, arg := range devices.mkfsArgs { <del> args = append(args, arg) <del> } <add> args = append(args, devices.mkfsArgs...) <ide> <ide> args = append(args, devname) <ide> <ide><path>daemon/logger/context.go <ide> func (ctx *Context) Hostname() (string, error) { <ide> // arguments. <ide> func (ctx *Context) Command() string { <ide> terms := []string{ctx.ContainerEntrypoint} <del> for _, arg := range ctx.ContainerArgs { <del> terms = append(terms, arg) <del> } <add> terms = append(terms, ctx.ContainerArgs...) <ide> command := strings.Join(terms, " ") <ide> return command <ide> } <ide><path>integration-cli/docker_cli_images_test.go <ide> func (s *DockerSuite) TestImagesFormat(c *check.C) { <ide> <ide> expected := []string{"myimage", "myimage"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with truncated names: %v, got: %v", expected, names)) <ide> } <ide> <ide><path>integration-cli/docker_cli_network_unix_test.go <ide> func (s *DockerSuite) TestNetworkLsFormat(c *check.C) { <ide> <ide> expected := []string{"bridge", "host", "none"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with truncated names: %v, got: %v", expected, names)) <ide> } <ide> <ide> func (s *DockerSuite) TestNetworkLsFormatDefaultFormat(c *check.C) { <ide> <ide> expected := []string{"bridge default", "host default", "none default"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with truncated names: %v, got: %v", expected, names)) <ide> } <ide> <ide><path>integration-cli/docker_cli_ps_test.go <ide> func (s *DockerSuite) TestPsFormatMultiNames(c *check.C) { <ide> lines := strings.Split(strings.TrimSpace(string(out)), "\n") <ide> expected := []string{"parent", "child,parent/linkedone"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with non-truncated names: %v, got: %v", expected, names)) <ide> <ide> //now list without turning off truncation and make sure we only get the non-link names <ide> out, _ = dockerCmd(c, "ps", "--format", "{{.Names}}") <ide> lines = strings.Split(strings.TrimSpace(string(out)), "\n") <ide> expected = []string{"parent", "child"} <ide> var truncNames []string <del> for _, l := range lines { <del> truncNames = append(truncNames, l) <del> } <add> truncNames = append(truncNames, lines...) <ide> c.Assert(expected, checker.DeepEquals, truncNames, check.Commentf("Expected array with truncated names: %v, got: %v", expected, truncNames)) <ide> } <ide> <ide> func (s *DockerSuite) TestPsNamesMultipleTime(c *check.C) { <ide> lines := strings.Split(strings.TrimSpace(string(out)), "\n") <ide> expected := []string{"test2 test2", "test1 test1"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with names displayed twice: %v, got: %v", expected, names)) <ide> } <ide> <ide><path>integration-cli/docker_cli_volume_test.go <ide> func (s *DockerSuite) TestVolumeLsFormat(c *check.C) { <ide> <ide> expected := []string{"aaa", "soo", "test"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with truncated names: %v, got: %v", expected, names)) <ide> } <ide> <ide> func (s *DockerSuite) TestVolumeLsFormatDefaultFormat(c *check.C) { <ide> <ide> expected := []string{"aaa default", "soo default", "test default"} <ide> var names []string <del> for _, l := range lines { <del> names = append(names, l) <del> } <add> names = append(names, lines...) <ide> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with truncated names: %v, got: %v", expected, names)) <ide> } <ide> <ide><path>pkg/discovery/file/file.go <ide> func parseFileContent(content []byte) []string { <ide> // Trim additional spaces caused by above stripping. <ide> line = strings.TrimSpace(line) <ide> } <del> for _, ip := range discovery.Generate(line) { <del> result = append(result, ip) <del> } <add> result = append(result, discovery.Generate(line)...) <ide> } <ide> return result <ide> } <ide><path>runconfig/opts/throttledevice.go <ide> func (opt *ThrottledeviceOpt) String() string { <ide> // GetList returns a slice of pointers to ThrottleDevices. <ide> func (opt *ThrottledeviceOpt) GetList() []*blkiodev.ThrottleDevice { <ide> var throttledevice []*blkiodev.ThrottleDevice <del> for _, v := range opt.values { <del> throttledevice = append(throttledevice, v) <del> } <add> throttledevice = append(throttledevice, opt.values...) <ide> <ide> return throttledevice <ide> }
11
Ruby
Ruby
remove extraneous flag conflicts
8f3d230995ed76dcd7c8dc8abd9bf0a27c761bae
<ide><path>Library/Homebrew/cmd/list.rb <ide> def list_args <ide> description: "Sort by time modified, listing most recently modified first." <ide> switch :verbose <ide> switch :debug <del> conflicts "--casks", "--unbrewed", "--multiple", "--pinned", "-l", "-r", "-t" <add> ["--unbrewed", "--multiple", "--pinned", "-l", "-r", "-t"].each { |flag| conflicts "--casks", flag } <ide> end <ide> end <ide>
1
PHP
PHP
remove redundant doc blocks
98f4673f27bd4e3851818536796074946327517a
<ide><path>src/Http/Cookie/Cookie.php <ide> public function toHeaderValue() <ide> } <ide> <ide> /** <del> * Create a cookie with an updated name <del> * <del> * @param string $name Name of the cookie <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withName($name) <ide> { <ide> public function withName($name) <ide> } <ide> <ide> /** <del> * Get the id for a cookie <del> * <del> * Cookies are unique across name, domain, path tuples. <del> * <del> * @return string <add> * {@inheritDoc} <ide> */ <ide> public function getId() <ide> { <ide> public function getId() <ide> } <ide> <ide> /** <del> * Gets the cookie name <del> * <del> * @return string <add> * {@inheritDoc} <ide> */ <ide> public function getName() <ide> { <ide> protected function validateName($name) <ide> } <ide> <ide> /** <del> * Gets the cookie value <del> * <del> * @return string|array <add> * {@inheritDoc} <ide> */ <ide> public function getValue() <ide> { <ide> return $this->value; <ide> } <ide> <ide> /** <del> * Create a cookie with an updated value. <del> * <del> * @param string|array $value Value of the cookie to set <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withValue($value) <ide> { <ide> protected function _setValue($value) <ide> } <ide> <ide> /** <del> * Create a new cookie with an updated path <del> * <del> * @param string $path Sets the path <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withPath($path) <ide> { <ide> public function withPath($path) <ide> } <ide> <ide> /** <del> * Get the path attribute. <del> * <del> * @return string <add> * {@inheritDoc} <ide> */ <ide> public function getPath() <ide> { <ide> return $this->path; <ide> } <ide> <ide> /** <del> * Create a cookie with an updated domain <del> * <del> * @param string $domain Domain to set <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withDomain($domain) <ide> { <ide> public function withDomain($domain) <ide> } <ide> <ide> /** <del> * Get the domain attribute. <del> * <del> * @return string <add> * {@inheritDoc} <ide> */ <ide> public function getDomain() <ide> { <ide> protected function validateString($value) <ide> } <ide> <ide> /** <del> * Check if the cookie is secure <del> * <del> * @return bool <add> * {@inheritDoc} <ide> */ <ide> public function isSecure() <ide> { <ide> return $this->secure; <ide> } <ide> <ide> /** <del> * Create a cookie with Secure updated <del> * <del> * @param bool $secure Secure attribute value <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withSecure($secure) <ide> { <ide> public function withSecure($secure) <ide> } <ide> <ide> /** <del> * Create a cookie with HTTP Only updated <del> * <del> * @param bool $httpOnly HTTP Only <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withHttpOnly($httpOnly) <ide> { <ide> protected function validateBool($value) <ide> } <ide> <ide> /** <del> * Check if the cookie is HTTP only <del> * <del> * @return bool <add> * {@inheritDoc} <ide> */ <ide> public function isHttpOnly() <ide> { <ide> return $this->httpOnly; <ide> } <ide> <ide> /** <del> * Create a cookie with an updated expiration date <del> * <del> * @param \DateTime|\DateTimeImmutable $dateTime Date time object <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withExpiry($dateTime) <ide> { <ide> public function withExpiry($dateTime) <ide> } <ide> <ide> /** <del> * Get the current expiry time <del> * <del> * @return \DateTime|\DateTimeImmutable|null Timestamp of expiry or null <add> * {@inheritDoc} <ide> */ <ide> public function getExpiry() <ide> { <ide> return $this->expiresAt; <ide> } <ide> <ide> /** <del> * Get the timestamp from the expiration time <del> * <del> * Timestamps are strings as large timestamps can overflow MAX_INT <del> * in 32bit systems. <del> * <del> * @return string|null The expiry time as a string timestamp. <add> * {@inheritDoc} <ide> */ <ide> public function getExpiresTimestamp() <ide> { <ide> public function getExpiresTimestamp() <ide> } <ide> <ide> /** <del> * Builds the expiration value part of the header string <del> * <del> * @return string <add> * {@inheritDoc} <ide> */ <ide> public function getFormattedExpires() <ide> { <ide> public function getFormattedExpires() <ide> } <ide> <ide> /** <del> * Check if a cookie is expired when compared to $time <del> * <del> * Cookies without an expiration date always return false. <del> * <del> * @param \DateTime|\DateTimeImmutable $time The time to test against. Defaults to 'now' in UTC. <del> * @return bool <add> * {@inheritDoc} <ide> */ <ide> public function isExpired($time = null) <ide> { <ide> public function isExpired($time = null) <ide> } <ide> <ide> /** <del> * Create a new cookie that will virtually never expire. <del> * <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withNeverExpire() <ide> { <ide> public function withNeverExpire() <ide> } <ide> <ide> /** <del> * Create a new cookie that will expire/delete the cookie from the browser. <del> * <del> * This is done by setting the expiration time to 1 year ago <del> * <del> * @return static <add> * {@inheritDoc} <ide> */ <ide> public function withExpired() <ide> {
1
Python
Python
use local insertion sort (solves #334) (#370)
c0033f92ade8153e85162ad9a7741eee2d3550bb
<ide><path>sorts/bucket_sort.py <ide> # This program will illustrate how to implement bucket sort algorithm <ide> <ide> # Wikipedia says: Bucket sort, or bin sort, is a sorting algorithm that works by distributing the <del># elements of an array into a number of buckets. Each bucket is then sorted individually, either using <add># elements of an array into a number of buckets. Each bucket is then sorted individually, either using <ide> # a different sorting algorithm, or by recursively applying the bucket sorting algorithm. It is a <ide> # distribution sort, and is a cousin of radix sort in the most to least significant digit flavour. <ide> # Bucket sort is a generalization of pigeonhole sort. Bucket sort can be implemented with comparisons <ide> # Best Case O(n); Average Case O(n); Worst Case O(n) <ide> <ide> from __future__ import print_function <del>from P26_InsertionSort import insertionSort <add>from insertion_sort import insertion_sort <ide> import math <ide> <ide> DEFAULT_BUCKET_SIZE = 5 <ide> def bucketSort(myList, bucketSize=DEFAULT_BUCKET_SIZE): <ide> # Sort buckets and place back into input array <ide> sortedArray = [] <ide> for i in range(0, len(buckets)): <del> insertionSort(buckets[i]) <add> insertion_sort(buckets[i]) <ide> for j in range(0, len(buckets[i])): <ide> sortedArray.append(buckets[i][j]) <ide>
1
Javascript
Javascript
add venmo oauth2 strategy
862ddb33fd520281336707ca8b05ed076dfbebf6
<ide><path>config/passport.js <ide> passport.use('foursquare', new OAuth2Strategy({ <ide> } <ide> )); <ide> <add>passport.use('venmo', new OAuth2Strategy({ <add> authorizationURL: 'https://api.venmo.com/v1/oauth/authorize', <add> tokenURL: 'https://api.venmo.com/v1/oauth/access_token', <add> clientID: secrets.venmo.clientId, <add> clientSecret: secrets.venmo.clientSecret, <add> callbackURL: secrets.venmo.redirectUrl, <add> passReqToCallback: true <add> }, <add> function (req, accessToken, refreshToken, profile, done) { <add> User.findById(req.user._id, function(err, user) { <add> user.tokens.push({ kind: 'venmo', accessToken: accessToken }); <add> user.save(function(err) { <add> done(err, user); <add> }); <add> }); <add> } <add>)); <add> <ide> exports.isAuthenticated = function(req, res, next) { <ide> if (req.isAuthenticated()) return next(); <ide> res.redirect('/login');
1
Text
Text
update the contributing file for root usage
fcfac4ba5921a60bbb9d0d19dd9fd7551436d26d
<ide><path>CONTRIBUTING.md <del># This board is for bug reports and feature requests only. If you need help, please use [stackoverflow](http://stackoverflow.com/questions/tagged/three.js). <add># The issues section is for bug reports and feature requests only. If you need help, please use [stackoverflow](http://stackoverflow.com/questions/tagged/three.js). <ide> <ide> ## How to report a bug. <ide>
1
PHP
PHP
improve code to break early
706e4640221804bc9615025753ce4c7ce5de51b8
<ide><path>src/Illuminate/Foundation/Testing/TestResponse.php <ide> public function assertJsonValidationErrors($errors) <ide> foreach (Arr::wrap($jsonErrors[$key]) as $jsonErrorMessage) { <ide> if (Str::contains($jsonErrorMessage, $value)) { <ide> $hasError = true; <add> break; <ide> } <ide> } <ide>
1
PHP
PHP
add tests for getrequest()
dd754b12c6c1171fa14ee00c851579422e2e5ac7
<ide><path>lib/Cake/Test/TestCase/Routing/RouterTest.php <ide> public function testSetRequestInfoLegacy() { <ide> $this->assertEquals('/', $result->webroot); <ide> } <ide> <add>/** <add> * test get request. <add> * <add> * @return void <add> */ <add> public function testGetRequest() { <add> $requestA = new Request('/', false); <add> $requestB = new Request('/posts', false); <add> <add> Router::pushRequest($requestA); <add> Router::pushRequest($requestB); <add> <add> $this->assertSame($requestA, Router::getRequest(false)); <add> $this->assertSame($requestB, Router::getRequest(true)); <add> } <add> <ide> /** <ide> * Test that Router::url() uses the first request <ide> */
1
Text
Text
improve array sort challenge
c27dc72e4dd3097c16b953c5d0d07d8767803151
<ide><path>curriculum/challenges/english/02-javascript-algorithms-and-data-structures/functional-programming/sort-an-array-alphabetically-using-the-sort-method.english.md <ide> challengeType: 1 <ide> The <code>sort</code> method sorts the elements of an array according to the callback function. <ide> For example: <ide> <blockquote>function ascendingOrder(arr) {<br>&nbsp;&nbsp;return arr.sort(function(a, b) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return a - b;<br>&nbsp;&nbsp;});<br>}<br>ascendingOrder([1, 5, 2, 3, 4]);<br>// Returns [1, 2, 3, 4, 5]<br><br>function reverseAlpha(arr) {<br>&nbsp;&nbsp;return arr.sort(function(a, b) {<br>&nbsp;&nbsp;&nbsp;&nbsp;return a === b ? 0 : a < b ? 1 : -1;<br>&nbsp;&nbsp;});<br>}<br>reverseAlpha(['l', 'h', 'z', 'b', 's']);<br>// Returns ['z', 's', 'l', 'h', 'b']</blockquote> <del>Note: It's encouraged to provide a callback function to specify how to sort the array items. JavaScript's default sorting method is by string Unicode point value, which may return unexpected results. <add>JavaScript's default sorting method is by string Unicode point value, which may return unexpected results. Therefore, it is encouraged to provide a callback function to specify how to sort the array items. When such a callback function, normally called <code>compareFunction</code>, is supplied, the array elements are sorted according to the return value of the <code>compareFunction</code>: <add>If <code>compareFunction(a,b)</code> returns a value less than 0 for two elements <code>a</code> and <code>b</code>, then <code>a</code> will come before <code>b</code>. <add>If <code>compareFunction(a,b)</code> returns a value greater than 0 for two elements <code>a</code> and <code>b</code>, then <code>b</code> will come before <code>a</code>. <add>If <code>compareFunction(a,b)</code> returns a value equal to 0 for two elements <code>a</code> and <code>b</code>, then <code>a</code> and <code>b</code> will remain unchanged. <add> <ide> </section> <ide> <ide> ## Instructions
1
Javascript
Javascript
check error message in test-http-outgoing-proto
1155ade002423eb62044598e13bf52a68f3330e5
<ide><path>test/parallel/test-http-outgoing-proto.js <ide> const OutgoingMessage = http.OutgoingMessage; <ide> const ClientRequest = http.ClientRequest; <ide> const ServerResponse = http.ServerResponse; <ide> <del>assert.throws(OutgoingMessage.prototype._implicitHeader); <add>assert.throws(OutgoingMessage.prototype._implicitHeader, <add> /^Error: _implicitHeader\(\) method is not implemented$/); <ide> assert.strictEqual( <ide> typeof ClientRequest.prototype._implicitHeader, 'function'); <ide> assert.strictEqual(
1
Text
Text
fix a typo that says you application [ci skip]
7f255245bd7c6de1037454e4e344175a4239aca5
<ide><path>guides/source/upgrading_ruby_on_rails.md <ide> part of the rewrite, the following features have been removed from the encoder: <ide> 2. Support for the `encode_json` hook <ide> 3. Option to encode `BigDecimal` objects as numbers instead of strings <ide> <del>If you application depends on one of these features, you can get them back by <add>If your application depends on one of these features, you can get them back by <ide> adding the [`activesupport-json_encoder`](https://github.com/rails/activesupport-json_encoder) <ide> gem to your Gemfile. <ide>
1
Javascript
Javascript
clarify ngapp usage
dc238ce123d6f4357878d0e6e58c8e2343337e26
<ide><path>src/Angular.js <ide> function encodeUriQuery(val, pctEncodeSpaces) { <ide> * @description <ide> * <ide> * Use this directive to auto-bootstrap an application. Only <del> * one directive can be used per HTML document. The directive <add> * one ngApp directive can be used per HTML document. The directive <ide> * designates the root of the application and is typically placed <ide> * at the root of the page. <add> * <add> * The first ngApp found in the document will be auto-bootstrapped. To use multiple applications in an <add> * HTML document you must manually bootstrap them using {@link angular.bootstrap}. <add> * Applications cannot be nested. <ide> * <ide> * In the example below if the `ngApp` directive would not be placed <ide> * on the `html` element then the document would not be compiled
1
Javascript
Javascript
enable native animations when possible
f9779e3eb79d50ddf0d80bbc0d047914d9e0c10c
<ide><path>Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js <ide> */ <ide> 'use strict'; <ide> <del>const NavigationTransitioner = require('NavigationTransitioner'); <add>const NativeAnimatedModule = require('NativeModules').NativeAnimatedModule; <ide> const NavigationCard = require('NavigationCard'); <del>const NavigationCardStackStyleInterpolator = require('NavigationCardStackStyleInterpolator'); <ide> const NavigationCardStackPanResponder = require('NavigationCardStackPanResponder'); <add>const NavigationCardStackStyleInterpolator = require('NavigationCardStackStyleInterpolator'); <ide> const NavigationPropTypes = require('NavigationPropTypes'); <add>const NavigationTransitioner = require('NavigationTransitioner'); <ide> const React = require('React'); <ide> const StyleSheet = require('StyleSheet'); <ide> const View = require('View'); <ide> class NavigationCardStack extends React.Component<DefaultProps, Props, void> { <ide> gestureResponseDistance: PropTypes.number, <ide> <ide> /** <del> * Enable gestures. Default value is true <add> * Enable gestures. Default value is true. <add> * <add> * When disabled, transition animations will be handled natively, which <add> * improves performance of the animation. In future iterations, gestures <add> * will also work with native-driven animation. <ide> */ <ide> enableGestures: PropTypes.bool, <ide> <ide> class NavigationCardStack extends React.Component<DefaultProps, Props, void> { <ide> render(): React.Element<any> { <ide> return ( <ide> <NavigationTransitioner <add> configureTransition={this._configureTransition} <ide> navigationState={this.props.navigationState} <ide> render={this._render} <ide> style={this.props.style} <ide> /> <ide> ); <ide> } <ide> <add> _configureTransition = () => { <add> const isVertical = this.props.direction === 'vertical'; <add> const animationConfig = {}; <add> if ( <add> !!NativeAnimatedModule <add> <add> // Gestures do not work with the current iteration of native animation <add> // driving. When gestures are disabled, we can drive natively. <add> && !this.props.enableGestures <add> <add> // Native animation support also depends on the transforms used: <add> && NavigationCardStackStyleInterpolator.canUseNativeDriver(isVertical) <add> ) { <add> animationConfig.useNativeDriver = true; <add> } <add> return animationConfig; <add> } <add> <ide> _render(props: NavigationTransitionProps): React.Element<any> { <ide> const { <del> renderHeader <add> renderHeader, <ide> } = this.props; <ide> <ide> const header = renderHeader ? <View>{renderHeader(props)}</View> : null; <ide><path>Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js <ide> function forVertical(props: NavigationSceneRendererProps): Object { <ide> }; <ide> } <ide> <add>function canUseNativeDriver(isVertical: boolean): boolean { <add> // The native driver can be enabled for this interpolator because the scale, <add> // translateX, and translateY transforms are supported with the native <add> // animation driver. <add> <add> return true; <add>} <add> <ide> module.exports = { <ide> forHorizontal, <ide> forVertical, <add> canUseNativeDriver, <ide> };
2
Text
Text
fix some typos in readme
0f65d8cbbe8be704670e337ad4383568babf5789
<ide><path>README.md <ide> This repo is tested on Python 2.7 and 3.5+ (examples are tested only on python 3 <ide> ### With pip <ide> <ide> First you need to install one of, or both, TensorFlow 2.0 and PyTorch. <del>Please refere to [TensorFlow installation page](https://www.tensorflow.org/install/pip#tensorflow-2.0-rc-is-available) and/or [PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) regarding the specific install command for your platform. <add>Please refer to [TensorFlow installation page](https://www.tensorflow.org/install/pip#tensorflow-2.0-rc-is-available) and/or [PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) regarding the specific install command for your platform. <ide> <ide> When TensorFlow 2.0 and/or PyTorch has been installed, 🤗 Transformers can be installed using pip as follows: <ide> <ide> pip install transformers <ide> ### From source <ide> <ide> Here also, you first need to install one of, or both, TensorFlow 2.0 and PyTorch. <del>Please refere to [TensorFlow installation page](https://www.tensorflow.org/install/pip#tensorflow-2.0-rc-is-available) and/or [PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) regarding the specific install command for your platform. <add>Please refer to [TensorFlow installation page](https://www.tensorflow.org/install/pip#tensorflow-2.0-rc-is-available) and/or [PyTorch installation page](https://pytorch.org/get-started/locally/#start-locally) regarding the specific install command for your platform. <ide> <ide> When TensorFlow 2.0 and/or PyTorch has been installed, you can install from source by cloning the repository and running: <ide> <ide> Here is a quick summary of what you should take care of when migrating from `pyt <ide> <ide> ### Models always output `tuples` <ide> <del>The main breaking change when migrating from `pytorch-pretrained-bert` to `transformers` is that the models forward method always outputs a `tuple` with various elements depending on the model and the configuration parameters. <add>The main breaking change when migrating from `pytorch-pretrained-bert` to `transformers` is that the model's forward method always outputs a `tuple` with various elements depending on the model and the configuration parameters. <ide> <ide> The exact content of the tuples for each model is detailed in the models' docstrings and the [documentation](https://huggingface.co/transformers/). <ide> <ide> By enabling the configuration option `output_hidden_states`, it was possible to <ide> <ide> Breaking change in the `from_pretrained()` method: <ide> <del>1. Models are now set in evaluation mode by default when instantiated with the `from_pretrained()` method. To train them don't forget to set them back in training mode (`model.train()`) to activate the dropout modules. <add>1. Models are now set in evaluation mode by default when instantiated with the `from_pretrained()` method. To train them, don't forget to set them back in training mode (`model.train()`) to activate the dropout modules. <ide> <del>2. The additional `*input` and `**kwargs` arguments supplied to the `from_pretrained()` method used to be directly passed to the underlying model's class `__init__()` method. They are now used to update the model configuration attribute instead which can break derived model classes build based on the previous `BertForSequenceClassification` examples. We are working on a way to mitigate this breaking change in [#866](https://github.com/huggingface/transformers/pull/866) by forwarding the the model `__init__()` method (i) the provided positional arguments and (ii) the keyword arguments which do not match any configuration class attributes. <add>2. The additional `*input` and `**kwargs` arguments supplied to the `from_pretrained()` method used to be directly passed to the underlying model's class `__init__()` method. They are now used to update the model configuration attribute instead, which can break derived model classes built based on the previous `BertForSequenceClassification` examples. We are working on a way to mitigate this breaking change in [#866](https://github.com/huggingface/transformers/pull/866) by forwarding the the model's `__init__()` method (i) the provided positional arguments and (ii) the keyword arguments which do not match any configuration class attributes. <ide> <ide> Also, while not a breaking change, the serialization methods have been standardized and you probably should switch to the new method `save_pretrained(save_directory)` if you were using any other serialization method before. <ide>
1
Javascript
Javascript
improve tests for thrown errors
7c5a5ce8ac34bd4bdecf2c33858b09e56ee61937
<ide><path>packages/container/tests/registry_test.js <ide> QUnit.test('Throw exception when trying to inject `type:thing` on all type(s)', <ide> <ide> throws(function() { <ide> registry.typeInjection('controller', 'injected', 'controller:post'); <del> }, 'Cannot inject a `controller:post` on other controller(s).'); <add> }, /Cannot inject a `controller:post` on other controller\(s\)\./); <ide> }); <ide> <ide> QUnit.test('The registry can take a hook to resolve factories lazily', function() { <ide> QUnit.test('validateFullName throws an error if name is incorrect', function() { <ide> registry.register('controller:post', PostController); <ide> throws(function() { <ide> registry.resolve('post'); <del> }, 'TypeError: Invalid Fullname, expected: `type:name` got: post'); <add> }, /TypeError: Invalid Fullname, expected: `type:name` got: post/); <ide> }); <ide> <ide> QUnit.test('The registry normalizes names when injecting', function() { <ide> QUnit.test('cannot re-register a factory if it has been resolved', function() { <ide> <ide> throws(function() { <ide> registry.register('controller:apple', SecondApple); <del> }, 'Cannot re-register: `controller:apple`, as it has already been resolved.'); <add> }, /Cannot re-register: `controller:apple`, as it has already been resolved\./); <ide> <ide> strictEqual(registry.resolve('controller:apple'), FirstApple); <ide> });
1
Javascript
Javascript
fix wrong example
2ec3b2120ee1c6cfeee1a400d5cbae1c7d3bf781
<ide><path>packages/ember-handlebars/lib/controls/select.js <ide> Ember.SelectOption = Ember.View.extend({ <ide> <ide> ```html <ide> <select class="ember-select"> <del> <option value>Please Select</option> <ide> <option value="1">Yehuda</option> <ide> <option value="2">Tom</option> <ide> </select> <ide> Ember.SelectOption = Ember.View.extend({ <ide> <ide> ```html <ide> <select class="ember-select"> <del> <option value>Please Select</option> <ide> <option value="1">Yehuda</option> <ide> <option value="2" selected="selected">Tom</option> <ide> </select> <ide> Ember.SelectOption = Ember.View.extend({ <ide> <ide> ```html <ide> <select class="ember-select"> <del> <option value>Please Select</option> <ide> <option value="1">Yehuda</option> <ide> <option value="2" selected="selected">Tom</option> <ide> </select>
1
Javascript
Javascript
add chop to showcase
518915a750b1f6871650599bbd742fbe028b19db
<ide><path>website/src/react-native/showcase.js <ide> var featured = [ <ide> linkPlayStore: 'https://app.jd.com/android.html', <ide> infoLink: 'http://ir.jd.com/phoenix.zhtml?c=253315&p=irol-homeProfile', <ide> infoTitle: 'JD.com is China’s largest ecommerce company by revenue and a member of the Fortune Global 500.', <del> } <add> }, <add> { <add> name: 'Chop', <add> icon: 'https://pbs.twimg.com/profile_images/656536498951446529/6zU6BvgB.png', <add> linkAppStore: 'http://apple.co/2dfkYH9', <add> infoLink: 'https://blog.getchop.io/how-we-built-chop-bae3d8acd131#.7y8buamrq', <add> infoTitle: 'How we built Chop', <add> } <ide> ]; <ide> <ide> /*
1
Javascript
Javascript
replace angular.annotate with annotate
d3fb5b411e979d0a4815c663c3489652fc5350f9
<ide><path>test/InjectorSpec.js <ide> describe('injector', function(){ <ide> <ide> describe('inject', function(){ <ide> it('should inject names', function(){ <del> expect(angular.annotate('a', {}).$inject).toEqual(['a']); <del> expect(angular.annotate('a', 'b', {}).$inject).toEqual(['a', 'b']); <add> expect(annotate('a', {}).$inject).toEqual(['a']); <add> expect(annotate('a', 'b', {}).$inject).toEqual(['a', 'b']); <ide> }); <ide> <ide> it('should inject array', function(){ <del> expect(angular.annotate(['a'], {}).$inject).toEqual(['a']); <del> expect(angular.annotate(['a', 'b'], {}).$inject).toEqual(['a', 'b']); <add> expect(annotate(['a'], {}).$inject).toEqual(['a']); <add> expect(annotate(['a', 'b'], {}).$inject).toEqual(['a', 'b']); <ide> }); <ide> }); <ide> });
1
Javascript
Javascript
add test case
2ec870f139cc1b1415fd1b46754a0571f2ffb122
<ide><path>test/ConfigCacheTestCases.longtest.js <del>const { describeCases } = require("./ConfigTestCases.template"); <add>const { describeCases, logErrors } = require("./ConfigTestCases.template"); <ide> <ide> describeCases({ <ide> name: "ConfigCacheTestCases", <add> infrastructureLogErrors: { <add> allowList: [ <add> { <add> // Pack got invalid because of write to: Compilation/modules|/home/runner/work/webpack/webpack/test/configCases/wasm/missing-wasm-experiment/wasm.wasm <add> category: "wasm", <add> test: "missing-wasm-experiment" <add> }, <add> { <add> // Pack got invalid because of write to: RealContentHashPlugin|analyse|index.html <add> category: "process-assets", <add> test: "html-plugin" <add> }, <add> { <add> // Pack got invalid because of write to: Compilation/modules|/home/runner/work/webpack/webpack/test/cases/parsing/context/templates/dump-file.txt <add> category: "parsing", <add> test: "context" <add> }, <add> { <add> // Pack got invalid because of write to: Compilation/modules|/home/runner/work/webpack/webpack/test/configCases/loaders/options/loader-1.js??ruleSet[1].rules[9]!/home/runner/work/webpack/webpack/test/configCases/loaders/options/error1.js <add> category: "loaders", <add> test: "options" <add> }, <add> { <add> // Pack got invalid because of write to: TerserWebpackPlugin|bundle0.js <add> category: "assets", <add> test: "delete-asset" <add> }, <add> { <add> // Pack got invalid because of write to: webpack.HttpUriPlugin|https://raw.githubusercontent.com//webpack//webpack//main/CODE_OF_CONDUCT.md <add> category: "asset-modules", <add> test: "http-url" <add> } <add> ], <add> filter: [logErrors.PERSISTENCE_CACHE_INVALIDATE_ERROR] <add> }, <ide> cache: { <ide> type: "filesystem", <ide> buildDependencies: { <ide><path>test/ConfigTestCases.template.js <ide> const { parseResource } = require("../lib/util/identifier"); <ide> const captureStdio = require("./helpers/captureStdio"); <ide> const asModule = require("./helpers/asModule"); <ide> <add>const PERSISTENCE_CACHE_INVALIDATE_ERROR = (log, config) => { <add> if (config.run < 2) return; <add> const match = <add> /^\[webpack\.cache\.PackFileCacheStrategy\] Pack got invalid because of write to:(.+)$/.exec( <add> log <add> ); <add> if (match) { <add> return `Pack got invalid because of write to: ${match[1].trim()}`; <add> } <add>}; <add> <ide> const casesPath = path.join(__dirname, "configCases"); <ide> const categories = fs.readdirSync(casesPath).map(cat => { <ide> return { <ide> const categories = fs.readdirSync(casesPath).map(cat => { <ide> }; <ide> }); <ide> <add>const createLogger = appendTarget => { <add> return { <add> log: l => appendTarget.push(l), <add> debug: l => appendTarget.push(l), <add> trace: l => appendTarget.push(l), <add> info: l => appendTarget.push(l), <add> warn: console.warn.bind(console), <add> error: console.error.bind(console), <add> logTime: () => {}, <add> group: () => {}, <add> groupCollapsed: () => {}, <add> groupEnd: () => {}, <add> profile: () => {}, <add> profileEnd: () => {}, <add> clear: () => {}, <add> status: () => {} <add> }; <add>}; <add> <add>const returnLogError = (logs, errorsFilter, config) => { <add> for (const log of logs) { <add> for (const filter of errorsFilter) { <add> const result = filter(log, config); <add> if (result) { <add> return new Error(result); <add> } <add> } <add> } <add>}; <add> <ide> const describeCases = config => { <add> let allowErrorsMap; <add> if (config.infrastructureLogErrors) { <add> allowErrorsMap = new Map(); <add> if (config.infrastructureLogErrors.allowList) { <add> for (const { category, test } of config.infrastructureLogErrors <add> .allowList) { <add> let byCategory = allowErrorsMap.get(category); <add> if (!byCategory) { <add> byCategory = new Set(); <add> allowErrorsMap.set(category, byCategory); <add> } <add> byCategory.add(test); <add> } <add> } <add> } <add> <ide> describe(config.name, () => { <ide> let stderr; <ide> beforeEach(() => { <ide> const describeCases = config => { <ide> // eslint-disable-next-line no-loop-func <ide> describe(category.name, () => { <ide> for (const testName of category.tests) { <add> const inAllowErrorsList = () => { <add> const byCategory = allowErrorsMap.get(category.name); <add> if (!byCategory) return false; <add> return byCategory.has(testName); <add> }; <ide> // eslint-disable-next-line no-loop-func <ide> describe(testName, function () { <ide> const testDirectory = path.join(casesPath, category.name, testName); <ide> const describeCases = config => { <ide> }); <ide> return; <ide> } <add> const infraStructureLog = []; <ide> const outBaseDir = path.join(__dirname, "js"); <ide> const testSubPath = path.join(config.name, category.name, testName); <ide> const outputDirectory = path.join(outBaseDir, testSubPath); <ide> const describeCases = config => { <ide> name: `config-${idx}`, <ide> ...config.cache <ide> }; <add> options.infrastructureLogging = { <add> debug: true, <add> console: createLogger(infraStructureLog) <add> }; <ide> } <ide> if (!options.snapshot) options.snapshot = {}; <ide> if (!options.snapshot.managedPaths) { <ide> const describeCases = config => { <ide> it(`${testName} should pre-compile to fill disk cache (1st)`, done => { <ide> rimraf.sync(outputDirectory); <ide> fs.mkdirSync(outputDirectory, { recursive: true }); <add> infraStructureLog.length = 0; <ide> const deprecationTracker = deprecationTracking.start(); <ide> require("..")(options, err => { <ide> deprecationTracker(); <ide> const describeCases = config => { <ide> ) <ide> ); <ide> } <add> if (config.infrastructureLogErrors) { <add> if (!inAllowErrorsList()) { <add> const error = returnLogError( <add> infraStructureLog, <add> Array.isArray(config.infrastructureLogErrors.filter) <add> ? config.infrastructureLogErrors.filter <add> : [config.infrastructureLogErrors.filter], <add> { <add> run: 1, <add> options <add> } <add> ); <add> if (error) return done(error); <add> } <add> } <ide> if (err) return handleFatalError(err, done); <ide> done(); <ide> }); <ide> }, 60000); <ide> it(`${testName} should pre-compile to fill disk cache (2nd)`, done => { <ide> rimraf.sync(outputDirectory); <ide> fs.mkdirSync(outputDirectory, { recursive: true }); <add> infraStructureLog.length = 0; <ide> const deprecationTracker = deprecationTracking.start(); <ide> require("..")(options, (err, stats) => { <ide> deprecationTracker(); <ide> const describeCases = config => { <ide> ); <ide> } <ide> } <add> if (config.infrastructureLogErrors) { <add> if (!inAllowErrorsList()) { <add> const error = returnLogError( <add> infraStructureLog, <add> Array.isArray(config.infrastructureLogErrors.filter) <add> ? config.infrastructureLogErrors.filter <add> : [config.infrastructureLogErrors.filter], <add> { <add> run: 2, <add> options <add> } <add> ); <add> if (error) return done(error); <add> } <add> } <ide> done(); <ide> }); <ide> }, 40000); <ide> } <ide> it(`${testName} should compile`, done => { <ide> rimraf.sync(outputDirectory); <ide> fs.mkdirSync(outputDirectory, { recursive: true }); <add> infraStructureLog.length = 0; <ide> const deprecationTracker = deprecationTracking.start(); <ide> const onCompiled = (err, stats) => { <ide> const deprecations = deprecationTracker(); <ide> const describeCases = config => { <ide> ) { <ide> return; <ide> } <add> if (config.infrastructureLogErrors) { <add> if (!inAllowErrorsList()) { <add> const error = returnLogError( <add> infraStructureLog, <add> Array.isArray(config.infrastructureLogErrors.filter) <add> ? config.infrastructureLogErrors.filter <add> : [config.infrastructureLogErrors.filter], <add> { <add> run: 3, <add> options <add> } <add> ); <add> if (error) return done(error); <add> } <add> } <ide> <ide> let filesCount = 0; <ide> <ide> const describeCases = config => { <ide> }; <ide> <ide> exports.describeCases = describeCases; <add>exports.logErrors = { <add> PERSISTENCE_CACHE_INVALIDATE_ERROR <add>};
2
Text
Text
fix typo in activejob guide [ci skip]
41739a2677ce52ea842c14f1bf3323256e0c6a10
<ide><path>guides/source/active_job_basics.md <ide> class GuestsCleanupJob < ActiveJob::Base <ide> queue_as :default <ide> <ide> before_enqueue do |job| <del> # do somthing with the job instance <add> # do something with the job instance <ide> end <ide> <ide> around_perform do |job, block|
1
Text
Text
add more translation in fundamentals
2db5c64849502534e2e96e7afb328e6b4b3839be
<ide><path>threejs/lessons/tr/threejs-fundamentals.md <ide> TOC: Temel Bilgiler <ide> <ide> Bu three.js ile alakalı makale serisindeki ilk makaledir. [Three.js](https://threejs.org) bir web sayfasına 3D içerik sağlamayı mümkün olduğunca kolaylaştırmaya çalışan bir 3D kütüphanedir. <ide> <del>Three.js sıklıkla WebGL ile karıştırılır fakat her zaman değil, three.js 3D çizim için WebGL kullanır. <add>Three.js her zaman olmasa da öncesine göre daha sıklıkla WebGl ile karıştırılır, three.js 3D çizim için WebGL kullanır. <ide> [WebGL yalnızca noktalar, çizgiler ve üçgenler çizen çok düşük seviyeli bir sistemdir](https://webglfundamentals.org). <ide> WebGL ile herhangi yararlı bir şey yapmak birazcık kod gerektirir ve three.js burada devreye girer. <ide> Sahneler, ışıklar, gölgeler, malzemeler, dokular, 3d matematik gibi şeyleri halleder, eğer direkt olarak WebGL kullansaydınız bunların hepsini kendiniz yazmak zorunda kalırdınız. <ide> <del>These tutorials assume you already know JavaScript and, for the <del>most part they will use ES6 style. [See here for a <del>terse list of things you're expected to already know](threejs-prerequisites.html). <del>Most browsers that support three.js are auto-updated so most users should <del>be able to run this code. If you'd like to make this code run <del>on really old browsers look into a transpiler like [Babel](https://babeljs.io). <del>Of course users running really old browsers probably have machines <del>that can't run three.js. <del> <del>When learning most programming languages the first thing people <del>do is make the computer print `"Hello World!"`. For 3D one <del>of the most common first things to do is to make a 3D cube. <del>So let's start with "Hello Cube!" <add>Bu dersler halihazırda Javascript bildiğinizi varsayar ve çoğu bölümünde ES6 stilini kullanacaklar. [Halihazırda bilmenizin beklendiği şeylerin kısa listesine buradan bakabilirsiniz](threejs-prerequisites.html). <add>Three.js'i destekleyen çoğu tarayıcı otomatik olarak desteklendiğinden çoğu kullanıcı bu kodu çalıştırabilir. Eğer bu kodu gerçekten eski tarayıcılarda çalıştırmak istiyorsanız [Babel](https://babeljs.io) gibi bir aktarıcıya bakın. <add>Elbette gerçekten eski tarayıcılarda çalışan kullanıcıların makineleri muhtemelen three.js'i çalıştırmayacaktır. <add> <add>Çoğu programlama dilini öğrenirken insanların ilk yaptığı şey <add>bilgisayara `"Hello World!"` yazısını yazdırmaktır. <add>3D için ise en yaygın olarak yapılan ilk şeylerden biri 3D bir küp yapmaktır. <add>Öyleyse gelin "Hello Cube!" ile başlayalım! <ide> <ide> Before we get started let's try to give you an idea of the structure <ide> of a three.js app. A three.js app requires you to create a bunch of
1
Java
Java
ignore failing test
8df6b86dd1efbb0a62be789e5b88897df5404148
<ide><path>org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7839Tests.java <ide> public void arrayOfLists() throws Exception { <ide> } <ide> <ide> @Test <add> @Ignore <ide> public void map() throws Exception { <ide> request.setRequestURI("/nested/map"); <ide> request.addParameter("nested.map['apple'].foo", "bar");
1
Ruby
Ruby
fix freeze applying to cloned objects
d5867a01a82d14216541c8bfc38e466b02580376
<ide><path>activerecord/lib/active_record/core.rb <ide> def hash <ide> id.hash <ide> end <ide> <del> # Freeze the attributes hash such that associations are still accessible, even on destroyed records. <add> # Clone and freeze the attributes hash such that associations are still <add> # accessible, even on destroyed records, but cloned models will not be <add> # frozen. <ide> def freeze <del> @attributes.freeze <add> @attributes = @attributes.clone.freeze <ide> self <ide> end <ide> <ide><path>activerecord/test/cases/clone_test.rb <ide> def test_shallow <ide> topic.author_name = 'Aaron' <ide> assert_equal 'Aaron', cloned.author_name <ide> end <add> <add> def test_freezing_a_cloned_model_does_not_freeze_clone <add> cloned = Topic.new <add> clone = cloned.clone <add> cloned.freeze <add> assert_not clone.frozen? <add> end <ide> end <ide> end
2
Ruby
Ruby
remove unnecessary nested if
0bf2f92f467b4b4cca889a9e53299772bd1641f9
<ide><path>Library/Homebrew/cmd/outdated.rb <ide> def outdated_brews(formulae) <ide> all_versions = [] <ide> older_or_same_tap_versions = [] <ide> <del> if f.oldname && !f.rack.exist? <del> if Pathname.new("#{HOMEBREW_CELLAR}/#{f.oldname}").exist? <del> raise Migrator::MigrationNeededError.new(f) <del> end <add> if f.oldname && !f.rack.exist? && (HOMEBREW_CELLAR/f.oldname).exist? <add> raise Migrator::MigrationNeededError.new(f) <ide> end <ide> <ide> f.rack.subdirs.each do |dir|
1
Mixed
Go
fix nits in comments
bc85efdb4fa637fcbef54864e8d3f0255c4bbe80
<ide><path>libnetwork/controller.go <ide> func (c *controller) SetKeys(keys []*types.EncryptionKey) error { <ide> } <ide> for s, count := range subsysKeys { <ide> if count != keyringSize { <del> return fmt.Errorf("incorrect number of keys for susbsystem %v", s) <add> return fmt.Errorf("incorrect number of keys for subsystem %v", s) <ide> } <ide> } <ide> <ide> func (c *controller) pushNodeDiscovery(d driverapi.Driver, cap driverapi.Capabil <ide> err = d.DiscoverDelete(discoverapi.NodeDiscovery, nodeData) <ide> } <ide> if err != nil { <del> logrus.Debugf("discovery notification error : %v", err) <add> logrus.Debugf("discovery notification error: %v", err) <ide> } <ide> } <ide> } <ide> func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s <ide> <ide> err = sb.storeUpdate() <ide> if err != nil { <del> return nil, fmt.Errorf("updating the store state of sandbox failed: %v", err) <add> return nil, fmt.Errorf("failed to update the store state of sandbox: %v", err) <ide> } <ide> <ide> return sb, nil <ide><path>libnetwork/docs/macvlan.md <ide> There are positive performance implication as a result of bypassing the Linux br <ide> <ide> - The driver limits one network per parent interface. The driver does however accommodate secondary subnets to be allocated in a single Docker network for a multi-subnet requirement. The upstream router is responsible for proxy-arping between the two subnets. <ide> <del>- Any Macvlan container sharing the same subnet can communicate via IP to any other container in the same subnet without a gateway. It is important to note, that the parent will go into promiscuous mode when a container is attached to the parent since each container has a unique MAC address. Alternatively, Ipvlan which is currently a experimental driver uses the same MAC address as the parent interface and thus precluding the need for the parent being promiscuous. <add>- Any Macvlan container sharing the same subnet can communicate via IP to any other container in the same subnet without a gateway. It is important to note, that the parent will go into promiscuous mode when a container is attached to the parent since each container has a unique MAC address. Alternatively, Ipvlan which is currently an experimental driver uses the same MAC address as the parent interface and thus precluding the need for the parent being promiscuous. <ide> <ide> In the following example, `eth0` on the docker host has an IP on the `172.16.86.0/24` network and a default gateway of `172.16.86.1`. The gateway is an external router with an address of `172.16.86.1`. An IP address is not required on the Docker host interface `eth0` in `bridge` mode, it merely needs to be on the proper upstream network to get forwarded by a network switch or network router. <ide> <ide> In the case of a host reboot, instead of needing to modify often complex network <ide> <ide> The same holds true if the network is deleted `docker network rm`. If driver created the sub-interface with `docker network create` it will remove the sub-interface link for the operator. <ide> <del>If the user doesn't want Docker to create and delete the `-o parent` sub-interface, then you simply pass a interface that already exists as the parent link. Parent interfaces such as `eth0` are not deleted, only interfaces that are slave links. <add>If the user doesn't want Docker to create and delete the `-o parent` sub-interface, then you simply pass an interface that already exists as the parent link. Parent interfaces such as `eth0` are not deleted, only interfaces that are slave links. <ide> <ide> For the driver to add/delete the vlan sub-interfaces the format needs to be `-o parent interface_name.vlan_tag`. <ide> <ide><path>libnetwork/driverapi/driverapi.go <ide> type Driver interface { <ide> // programming to allow the external connectivity dictated by the passed options <ide> ProgramExternalConnectivity(nid, eid string, options map[string]interface{}) error <ide> <del> // RevokeExternalConnectivity aks the driver to remove any external connectivity <add> // RevokeExternalConnectivity asks the driver to remove any external connectivity <ide> // programming that was done so far <ide> RevokeExternalConnectivity(nid, eid string) error <ide> <ide> type Driver interface { <ide> // only invoked for the global scope driver. <ide> EventNotify(event EventType, nid string, tableName string, key string, value []byte) <ide> <del> // Type returns the the type of this driver, the network type this driver manages <add> // Type returns the type of this driver, the network type this driver manages <ide> Type() string <ide> <ide> // IsBuiltIn returns true if it is a built-in driver <ide><path>libnetwork/drivers/windows/overlay/peerdb_windows.go <ide> func (d *driver) peerAdd(nid, eid string, peerIP net.IP, peerIPMask net.IPMask, <ide> return err <ide> } <ide> <del> // Temp: We have to create a endpoint object to keep track of the HNS ID for <add> // Temp: We have to create an endpoint object to keep track of the HNS ID for <ide> // this endpoint so that we can retrieve it later when the endpoint is deleted. <ide> // This seems unnecessary when we already have dockers EID. See if we can pass <ide> // the global EID to HNS to use as it's ID, rather than having each HNS assign <ide><path>libnetwork/libnetwork_linux_test.go <ide> func TestEndpointJoin(t *testing.T) { <ide> } <ide> <ide> if info.Sandbox() == nil { <del> t.Fatalf("Expected an non-empty sandbox key for a joined endpoint. Instead found a empty sandbox key") <add> t.Fatalf("Expected an non-empty sandbox key for a joined endpoint. Instead found an empty sandbox key") <ide> } <ide> <ide> // Check endpoint provided container information <ide><path>libnetwork/sandbox.go <ide> type Sandbox interface { <ide> // EnableService makes a managed container's service available by adding the <ide> // endpoint to the service load balancer and service discovery <ide> EnableService() error <del> // DisableService removes a managed contianer's endpoints from the load balancer <add> // DisableService removes a managed container's endpoints from the load balancer <ide> // and service discovery <ide> DisableService() error <ide> }
6
Text
Text
bring dab into title and intro
6defef56194e7fe74f6f1bbc0ccb0565bc51ffd1
<add><path>experimental/docker-stacks-and-bundles.md <del><path>experimental/docker-stacks.md <del># Docker Stacks <add># Docker Stacks and Distributed Application Bundles <ide> <ide> ## Overview <ide> <del>Docker Stacks are an experimental feature introduced in Docker 1.12, alongside <del>the concept of swarm mode, and Nodes and Services in the Engine API. <add>Docker Stacks and Distributed Application Bundles are experimental features introduced in Docker 1.12 and Docker Compose 1.8, alongside the concept of swarm mode, and Nodes and Services in the Engine API. <ide> <ide> A Dockerfile can be built into an image, and containers can be created from that <ide> image. Similarly, a docker-compose.yml can be built into a **distributed application bundle**, and **stacks** can be created from that bundle. In that sense, the bundle is a multi-services distributable image format. <ide> <del>As of Docker 1.12, the feature is experimental. Neither Docker Engine nor the Docker Registry support distribution of bundles. <add>As of Docker 1.12 and Compose 1.8, the features are experimental. Neither Docker Engine nor the Docker Registry support distribution of bundles. <ide> <ide> ## Producing a bundle <ide>
1
Javascript
Javascript
redirect /challenges/* to /learn/*
4a45b5ac1c010e7733221b263971b9e5f1f6d50b
<ide><path>client/gatsby-node.js <ide> exports.onCreateBabelConfig = ({ actions }) => { <ide> }); <ide> }; <ide> <add>exports.onCreatePage = async ({ page, actions }) => { <add> const { createPage } = actions; <add> // Only update the `/challenges` page. <add> if (page.path.match(/^\/challenges/)) { <add> // page.matchPath is a special key that's used for matching pages <add> // with corresponding routes only on the client. <add> page.matchPath = '/challenges/*'; <add> // Update the page. <add> createPage(page); <add> } <add>}; <add> <ide> // TODO: this broke the React challenges, not sure why, but I'll investigate <ide> // further and reimplement if it's possible and necessary (Oliver) <ide> // Typically the schema can be inferred, but not when some challenges are <ide><path>client/src/pages/challenges.js <add>// this exists purely to redirect legacy challenge paths to /learn <add>import React from 'react'; <add>import { Router } from '@reach/router'; <add>import { navigate } from 'gatsby'; <add> <add>import createRedirect from '../components/createRedirect'; <add> <add>const RedirectToLearn = createRedirect('/learn'); <add> <add>const Redirect = props => { <add> if (typeof window !== 'undefined') { <add> navigate(toLearnPath(props)); <add> } <add> return null; <add>}; <add> <add>const Challenges = () => ( <add> <Router basepath='/challenges'> <add> <Redirect path='/:superBlock/' /> <add> <Redirect path='/:superBlock/:block/' /> <add> <Redirect path='/:superBlock/:block/:challenge' /> <add> <RedirectToLearn default={true} /> <add> </Router> <add>); <add> <add>Challenges.displayName = 'Challenges'; <add> <add>export function toLearnPath({ superBlock, block, challenge }) { <add> let path = '/learn'; <add> if (superBlock) path += `/${superBlock}`; <add> if (block) path += `/${block}`; <add> if (challenge) path += `/${challenge}`; <add> return path; <add>} <add> <add>export default Challenges; <ide><path>client/src/pages/challenges.test.js <add>/* global expect */ <add>import { toLearnPath } from './challenges'; <add> <add>describe('toLearnPath', () => { <add> it('should return a string', () => { <add> expect(typeof toLearnPath({})).toBe('string'); <add> }); <add> it('should include /learn', () => { <add> expect(toLearnPath({})).toMatch(/\/learn/); <add> }); <add> it('should include superBlock after learn', () => { <add> expect(toLearnPath({ superBlock: 'testSuper' })).toBe('/learn/testSuper'); <add> }); <add> it('should include superBlock, then block after learn', () => { <add> expect(toLearnPath({ superBlock: 'testSuper', block: 'testBlock' })).toBe( <add> '/learn/testSuper/testBlock' <add> ); <add> }); <add> it('should include superBlock, block, then challenge after learn', () => { <add> expect( <add> toLearnPath({ <add> superBlock: 'testSuper', <add> block: 'testBlock', <add> challenge: 'testChallenge' <add> }) <add> ).toBe('/learn/testSuper/testBlock/testChallenge'); <add> }); <add>}); <ide><path>cypress/integration/learn/redirects/challenges.js <add>/* global cy expect */ <add> <add>const locations = { <add> chalSuper: '/challenges/responsive-web-design/', <add> chalBlock: '/challenges/responsive-web-design/basic-html-and-html5', <add> chalChallenge: <add> // eslint-disable-next-line max-len <add> '/challenges/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements', <add> learnSuper: '/learn/responsive-web-design', <add> learnBlock: '/learn/responsive-web-design/basic-html-and-html5', <add> learnChallenge: <add> // eslint-disable-next-line max-len <add> '/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements' <add>}; <add> <add>describe('challenges/superblock redirect', function() { <add> it('redirects to learn/superblock', () => { <add> cy.visit(locations.chalSuper); <add> <add> cy.title().should('eq', 'Responsive Web Design | freeCodeCamp.org'); <add> cy.location().should(loc => { <add> expect(loc.pathname).to.eq(locations.learnSuper); <add> }); <add> }); <add>}); <add> <add>describe('challenges/superblock/block redirect', function() { <add> it('redirects to learn/superblock/block', () => { <add> cy.visit(locations.chalBlock); <add> <add> cy.title().should('eq', 'Basic HTML and HTML5 | freeCodeCamp.org'); <add> cy.location().should(loc => { <add> expect(loc.pathname).to.eq(locations.learnBlock); <add> }); <add> }); <add>}); <add> <add>describe('challenges/superblock/block/challenge redirect', function() { <add> it('redirects to learn/superblock/block/challenge', () => { <add> cy.visit(locations.chalChallenge); <add> <add> cy.title().should( <add> 'eq', <add> // eslint-disable-next-line max-len <add> 'Learn Basic HTML and HTML5: Say Hello to HTML Elements | freeCodeCamp.org' <add> ); <add> cy.location().should(loc => { <add> expect(loc.pathname).to.eq(locations.learnChallenge); <add> }); <add> }); <add>});
4
Python
Python
ensure dispatcher typeerrors report original name
8fabdecb556354559f9dcc280c75001f3df8aaa8
<ide><path>numpy/core/overrides.py <ide> import collections <ide> import functools <ide> import os <add>import sys <ide> <ide> from numpy.core._multiarray_umath import ( <ide> add_docstring, implement_array_function, _get_implementing_args) <ide> def decorator(implementation): <ide> <ide> @functools.wraps(implementation) <ide> def public_api(*args, **kwargs): <del> relevant_args = dispatcher(*args, **kwargs) <add> try: <add> relevant_args = dispatcher(*args, **kwargs) <add> except TypeError as exc: <add> # Try to clean up a signature related TypeError. Such an <add> # error will be something like: <add> # dispatcher.__name__() got an unexpected keyword argument <add> # <add> # So replace the dispatcher name in this case. In principle <add> # TypeErrors may be raised from _within_ the dispatcher, so <add> # we check that the traceback contains a string that starts <add> # with the name. (In principle we could also check the <add> # traceback length, as it would be deeper.) <add> msg = exc.args[0] <add> disp_name = dispatcher.__name__ <add> if not isinstance(msg, str) or not msg.startswith(disp_name): <add> raise <add> <add> # Replace with the correct name and re-raise: <add> new_msg = msg.replace(disp_name, public_api.__name__) <add> raise TypeError(new_msg) from None <add> <ide> return implement_array_function( <ide> implementation, public_api, relevant_args, args, kwargs) <ide> <ide><path>numpy/core/tests/test_overrides.py <ide> def func(array): <ide> TypeError, "no implementation found for 'my.func'"): <ide> func(MyArray()) <ide> <add> def test_signature_error_message(self): <add> # The lambda function will be named "<lambda>", but the TypeError <add> # should show the name as "func" <add> def _dispatcher(): <add> return () <add> <add> @array_function_dispatch(_dispatcher) <add> def func(): <add> pass <add> <add> try: <add> func(bad_arg=3) <add> except TypeError as e: <add> expected_exception = e <add> <add> try: <add> func(bad_arg=3) <add> raise AssertionError("must fail") <add> except TypeError as exc: <add> assert exc.args == expected_exception.args <add> <add> @pytest.mark.parametrize("value", [234, "this func is not replaced"]) <add> def test_dispatcher_error(self, value): <add> # If the dispatcher raises an error, we must not attempt to mutate it <add> error = TypeError(value) <add> <add> def dispatcher(): <add> raise error <add> <add> @array_function_dispatch(dispatcher) <add> def func(): <add> return 3 <add> <add> try: <add> func() <add> raise AssertionError("must fail") <add> except TypeError as exc: <add> assert exc is error # unmodified exception <add> <ide> <ide> class TestNDArrayMethods: <ide>
2
Javascript
Javascript
create dedicated debug endpoints
c9084aea2c30c4e1e341651e48483dd3e1ceda4b
<ide><path>api-server/server/boot/sentry-debug.js <add>import { wrapHandledError } from '../utils/create-handled-error'; <add> <add>export default function bootStatus(app) { <add> const api = app.loopback.Router(); <add> <add> // DEBUG ROUTE <add> api.get('/sentry/error', () => { <add> throw Error('debugging sentry'); <add> }); <add> api.get('/sentry/wrapped', () => { <add> throw wrapHandledError(Error('debugging sentry, wrapped'), { <add> type: 'info', <add> message: 'debugmessage', <add> redirectTo: `a/page` <add> }); <add> }); <add> app.use(api); <add>}
1
Ruby
Ruby
handle duplicate migration names in multi db
1a1c455a5542b02ec91ca9fc93d5a4acff362820
<ide><path>activerecord/lib/active_record/migration.rb <ide> def migration <ide> end <ide> <ide> def load_migration <del> require(File.expand_path(filename)) <add> Object.send(:remove_const, name) rescue nil <add> <add> load(File.expand_path(filename)) <ide> name.constantize.new(name, version) <ide> end <ide> end <ide><path>activerecord/test/cases/migration_test.rb <ide> require MIGRATIONS_ROOT + "/rename/2_rename_things" <ide> require MIGRATIONS_ROOT + "/decimal/1_give_me_big_numbers" <ide> <add>class ValidPeopleHaveLastNames < ActiveRecord::Migration::Current <add> def change <add> drop_table :people <add> end <add>end <add> <ide> class BigNumber < ActiveRecord::Base <ide> unless current_adapter?(:PostgreSQLAdapter, :SQLite3Adapter) <ide> attribute :value_of_e, :integer <ide> def test_migrator_versions <ide> assert_equal true, migrator.needs_migration? <ide> end <ide> <add> def test_name_collision_across_dbs <add> migrations_path = MIGRATIONS_ROOT + "/valid" <add> migrator = ActiveRecord::MigrationContext.new(migrations_path) <add> migrator.up <add> <add> assert_column Person, :last_name <add> end <add> <ide> def test_migration_detection_without_schema_migration_table <ide> ActiveRecord::Base.connection.drop_table "schema_migrations", if_exists: true <ide>
2
PHP
PHP
document the assoc arrays as per their string key
bb4d2c947c8a3570b0664d84bafc99013db010db
<ide><path>src/Auth/AbstractPasswordHasher.php <ide> abstract class AbstractPasswordHasher <ide> * <ide> * These are merged with user-provided config when the object is used. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> /** <ide> * Constructor <ide> * <del> * @param array $config Array of config. <add> * @param array<string, mixed> $config Array of config. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Auth/BaseAuthenticate.php <ide> abstract class BaseAuthenticate implements EventListenerInterface <ide> * or an array containing `className` key, any other keys will be passed as <ide> * config to the class. Defaults to 'Default'. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'fields' => [ <ide> abstract class BaseAuthenticate implements EventListenerInterface <ide> * Constructor <ide> * <ide> * @param \Cake\Controller\ComponentRegistry $registry The Component registry used on this request. <del> * @param array $config Array of config to use. <add> * @param array<string, mixed> $config Array of config to use. <ide> */ <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> { <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> * @param string $username The username/identifier. <ide> * @param string|null $password The password, if not provided password checking is skipped <ide> * and result of find is returned. <del> * @return array|false Either false on failure, or an array of user data. <add> * @return array<string, mixed>|false Either false on failure, or an array of user data. <ide> */ <ide> protected function _findUser(string $username, ?string $password = null) <ide> { <ide> public function needsPasswordRehash(): bool <ide> * <ide> * @param \Cake\Http\ServerRequest $request Request to get authentication information from. <ide> * @param \Cake\Http\Response $response A response object that can have headers added. <del> * @return array|false Either false on failure, or an array of user data on success. <add> * @return array<string, mixed>|false Either false on failure, or an array of user data on success. <ide> */ <ide> abstract public function authenticate(ServerRequest $request, Response $response); <ide> <ide> abstract public function authenticate(ServerRequest $request, Response $response <ide> * systems like basic and digest auth. <ide> * <ide> * @param \Cake\Http\ServerRequest $request Request object. <del> * @return array|false Either false or an array of user information <add> * @return array<string, mixed>|false Either false or an array of user information <ide> */ <ide> public function getUser(ServerRequest $request) <ide> { <ide><path>src/Auth/BaseAuthorize.php <ide> abstract class BaseAuthorize <ide> /** <ide> * Default config for authorize objects. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> /** <ide> * Constructor <ide> * <ide> * @param \Cake\Controller\ComponentRegistry $registry The controller for this request. <del> * @param array $config An array of config. This class does not use any config. <add> * @param array<string, mixed> $config An array of config. This class does not use any config. <ide> */ <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> { <ide><path>src/Auth/BasicAuthenticate.php <ide> public function authenticate(ServerRequest $request, Response $response) <ide> * Get a user based on information in the request. Used by cookie-less auth for stateless clients. <ide> * <ide> * @param \Cake\Http\ServerRequest $request Request object. <del> * @return array|false Either false or an array of user information <add> * @return array<string, mixed>|false Either false or an array of user information <ide> */ <ide> public function getUser(ServerRequest $request) <ide> { <ide><path>src/Auth/DefaultPasswordHasher.php <ide> class DefaultPasswordHasher extends AbstractPasswordHasher <ide> * - `hashOptions` - Associative array of options. Check the PHP manual for <ide> * supported options for each hash type. Defaults to empty array. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'hashType' => PASSWORD_DEFAULT, <ide><path>src/Auth/DigestAuthenticate.php <ide> class DigestAuthenticate extends BasicAuthenticate <ide> * <ide> * @param \Cake\Controller\ComponentRegistry $registry The Component registry <ide> * used on this request. <del> * @param array $config Array of config to use. <add> * @param array<string, mixed> $config Array of config to use. <ide> */ <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> { <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> * Get a user based on information in the request. Used by cookie-less auth for stateless clients. <ide> * <ide> * @param \Cake\Http\ServerRequest $request Request object. <del> * @return array|false Either false or an array of user information <add> * @return array<string, mixed>|false Either false or an array of user information <ide> */ <ide> public function getUser(ServerRequest $request) <ide> { <ide><path>src/Auth/FallbackPasswordHasher.php <ide> class FallbackPasswordHasher extends AbstractPasswordHasher <ide> /** <ide> * Default config for this object. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'hashers' => [], <ide> class FallbackPasswordHasher extends AbstractPasswordHasher <ide> /** <ide> * Constructor <ide> * <del> * @param array $config configuration options for this object. Requires the <add> * @param array<string, mixed> $config configuration options for this object. Requires the <ide> * `hashers` key to be present in the array with a list of other hashers to be <ide> * used. <ide> */ <ide><path>src/Auth/FormAuthenticate.php <ide> class FormAuthenticate extends BaseAuthenticate <ide> * Checks the fields to ensure they are supplied. <ide> * <ide> * @param \Cake\Http\ServerRequest $request The request that contains login information. <del> * @param array $fields The fields to be checked. <add> * @param array<string, string> $fields The fields to be checked. <ide> * @return bool False if the fields have not been supplied. True if they exist. <ide> */ <ide> protected function _checkFields(ServerRequest $request, array $fields): bool <ide> protected function _checkFields(ServerRequest $request, array $fields): bool <ide> * <ide> * @param \Cake\Http\ServerRequest $request The request that contains login information. <ide> * @param \Cake\Http\Response $response Unused response object. <del> * @return array|false False on login failure. An array of User data on success. <add> * @return array<string, mixed>|false False on login failure. An array of User data on success. <ide> */ <ide> public function authenticate(ServerRequest $request, Response $response) <ide> { <ide><path>src/Auth/Storage/SessionStorage.php <ide> class SessionStorage implements StorageInterface <ide> * - `key` - Session key used to store user record. <ide> * - `redirect` - Session key used to store redirect URL. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'key' => 'Auth.User', <ide> class SessionStorage implements StorageInterface <ide> * <ide> * @param \Cake\Http\ServerRequest $request Request instance. <ide> * @param \Cake\Http\Response $response Response instance. <del> * @param array $config Configuration list. <add> * @param array<string, mixed> $config Configuration list. <ide> */ <ide> public function __construct(ServerRequest $request, Response $response, array $config = []) <ide> { <ide><path>src/Auth/WeakPasswordHasher.php <ide> class WeakPasswordHasher extends AbstractPasswordHasher <ide> /** <ide> * Default config for this object. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'hashType' => null, <ide><path>src/Cache/CacheEngine.php <ide> abstract class CacheEngine implements CacheInterface, CacheEngineInterface <ide> * - `warnOnWriteFailures` Some engines, such as ApcuEngine, may raise warnings on <ide> * write failures. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'duration' => 3600, <ide> abstract class CacheEngine implements CacheInterface, CacheEngineInterface <ide> * Called automatically by the cache frontend. Merge the runtime config with the defaults <ide> * before use. <ide> * <del> * @param array $config Associative array of parameters for the engine <add> * @param array<string, mixed> $config Associative array of parameters for the engine <ide> * @return bool True if the engine has been successfully initialized, false if not <ide> */ <ide> public function init(array $config = []): bool <ide><path>src/Cache/CacheRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param \Cake\Cache\CacheEngine|string $class The classname or object to make. <ide> * @param string $alias The alias of the object. <del> * @param array $config An array of settings to use for the cache engine. <add> * @param array<string, mixed> $config An array of settings to use for the cache engine. <ide> * @return \Cake\Cache\CacheEngine The constructed CacheEngine class. <ide> * @throws \RuntimeException when an object doesn't implement the correct interface. <ide> */ <ide><path>src/Cache/Engine/ApcuEngine.php <ide> class ApcuEngine extends CacheEngine <ide> * <ide> * Called automatically by the cache frontend <ide> * <del> * @param array $config array of setting for the engine <add> * @param array<string, mixed> $config array of setting for the engine <ide> * @return bool True if the engine has been successfully initialized, false if not <ide> */ <ide> public function init(array $config = []): bool <ide><path>src/Cache/Engine/FileEngine.php <ide> class FileEngine extends CacheEngine <ide> * cache::gc from ever being called automatically. <ide> * - `serialize` Should cache objects be serialized first. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'duration' => 3600, <ide> class FileEngine extends CacheEngine <ide> * <ide> * Called automatically by the cache frontend. <ide> * <del> * @param array $config array of setting for the engine <add> * @param array<string, mixed> $config array of setting for the engine <ide> * @return bool True if the engine has been successfully initialized, false if not <ide> */ <ide> public function init(array $config = []): bool <ide><path>src/Cache/Engine/MemcachedEngine.php <ide> class MemcachedEngine extends CacheEngine <ide> * - `options` - Additional options for the memcached client. Should be an array of option => value. <ide> * Use the \Memcached::OPT_* constants as keys. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'compress' => false, <ide> class MemcachedEngine extends CacheEngine <ide> * <ide> * Called automatically by the cache frontend <ide> * <del> * @param array $config array of setting for the engine <add> * @param array<string, mixed> $config array of setting for the engine <ide> * @return bool True if the engine has been successfully initialized, false if not <ide> * @throws \InvalidArgumentException When you try use authentication without <ide> * Memcached compiled with SASL support <ide><path>src/Cache/Engine/RedisEngine.php <ide> class RedisEngine extends CacheEngine <ide> * - `timeout` timeout in seconds (float). <ide> * - `unix_socket` Path to the unix socket file (default: false) <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'database' => 0, <ide> class RedisEngine extends CacheEngine <ide> * <ide> * Called automatically by the cache frontend <ide> * <del> * @param array $config array of setting for the engine <add> * @param array<string, mixed> $config array of setting for the engine <ide> * @return bool True if the engine has been successfully initialized, false if not <ide> */ <ide> public function init(array $config = []): bool <ide><path>src/Cache/Engine/WincacheEngine.php <ide> class WincacheEngine extends CacheEngine <ide> * <ide> * Called automatically by the cache frontend <ide> * <del> * @param array $config array of setting for the engine <add> * @param array<string, mixed> $config array of setting for the engine <ide> * @return bool True if the engine has been successfully initialized, false if not <ide> */ <ide> public function init(array $config = []): bool <ide><path>src/Command/PluginAssetsTrait.php <ide> protected function _list(?string $name = null): array <ide> /** <ide> * Process plugins <ide> * <del> * @param array $plugins List of plugins to process <add> * @param array<string, mixed> $plugins List of plugins to process <ide> * @param bool $copy Force copy mode. Default false. <ide> * @param bool $overwrite Overwrite existing files. <ide> * @return void <ide> protected function _process(array $plugins, bool $copy = false, bool $overwrite <ide> /** <ide> * Remove folder/symlink. <ide> * <del> * @param array $config Plugin config. <add> * @param array<string, mixed> $config Plugin config. <ide> * @return bool <ide> */ <ide> protected function _remove(array $config): bool <ide><path>src/Console/CommandCollection.php <ide> class CommandCollection implements IteratorAggregate, Countable <ide> /** <ide> * Command list <ide> * <del> * @var array <del> * @psalm-var array<\Cake\Console\Shell|\Cake\Console\CommandInterface|class-string> <add> * @var array<string, \Cake\Console\Shell|\Cake\Console\CommandInterface|string> <add> * @psalm-var array<string, \Cake\Console\Shell|\Cake\Console\CommandInterface|class-string> <ide> * @psalm-suppress DeprecatedClass <ide> */ <ide> protected $commands = []; <ide> <ide> /** <ide> * Constructor <ide> * <del> * @param array $commands The map of commands to add to the collection. <add> * @param array<string, \Cake\Console\Shell|\Cake\Console\CommandInterface|string> $commands The map of commands to add to the collection. <ide> */ <ide> public function __construct(array $commands = []) <ide> { <ide> public function add(string $name, $command) <ide> /** <ide> * Add multiple commands at once. <ide> * <del> * @param array $commands A map of command names => command classes/instances. <add> * @param array<string, \Cake\Console\Shell|\Cake\Console\CommandInterface|string> $commands A map of command names => command classes/instances. <ide> * @return $this <ide> * @see \Cake\Console\CommandCollection::add() <ide> */ <ide><path>src/Console/ConsoleIo.php <ide> public function setLoggers($enable): void <ide> * object has not already been loaded, it will be loaded and constructed. <ide> * <ide> * @param string $name The name of the helper to render <del> * @param array $settings Configuration data for the helper. <add> * @param array<string, mixed> $config Configuration data for the helper. <ide> * @return \Cake\Console\Helper The created helper instance. <ide> */ <del> public function helper(string $name, array $settings = []): Helper <add> public function helper(string $name, array $config = []): Helper <ide> { <ide> $name = ucfirst($name); <ide> <del> return $this->_helpers->load($name, $settings); <add> return $this->_helpers->load($name, $config); <ide> } <ide> <ide> /** <ide> public function helper(string $name, array $settings = []): Helper <ide> * <ide> * @param string $path The path to create the file at. <ide> * @param string $contents The contents to put into the file. <del> * @param bool $forceOverwrite Whether or not the file should be overwritten. <del> * If true, no question will be asked about whether or not to overwrite existing files. <add> * @param bool $forceOverwrite Whether the file should be overwritten. <add> * If true, no question will be asked about whether to overwrite existing files. <ide> * @return bool Success. <ide> * @throws \Cake\Console\Exception\StopException When `q` is given as an answer <del> * to whether or not a file should be overwritten. <add> * to whether a file should be overwritten. <ide> */ <ide> public function createFile(string $path, string $contents, bool $forceOverwrite = false): bool <ide> { <ide><path>src/Console/ConsoleOptionParser.php <ide> class ConsoleOptionParser <ide> * Option definitions. <ide> * <ide> * @see \Cake\Console\ConsoleOptionParser::addOption() <del> * @var array<\Cake\Console\ConsoleInputOption> <add> * @var array<string, \Cake\Console\ConsoleInputOption> <ide> */ <ide> protected $_options = []; <ide> <ide> class ConsoleOptionParser <ide> * Subcommands for this Shell. <ide> * <ide> * @see \Cake\Console\ConsoleOptionParser::addSubcommand() <del> * @var array<\Cake\Console\ConsoleInputSubcommand> <add> * @var array<string, \Cake\Console\ConsoleInputSubcommand> <ide> */ <ide> protected $_subcommands = []; <ide> <ide> public function argumentNames() <ide> /** <ide> * Get the defined options in the parser. <ide> * <del> * @return array<\Cake\Console\ConsoleInputOption> <add> * @return array<string, \Cake\Console\ConsoleInputOption> <ide> */ <ide> public function options() <ide> { <ide> public function options() <ide> /** <ide> * Get the array of defined subcommands <ide> * <del> * @return array<\Cake\Console\ConsoleInputSubcommand> <add> * @return array<string, \Cake\Console\ConsoleInputSubcommand> <ide> */ <ide> public function subcommands() <ide> { <ide><path>src/Console/ConsoleOutput.php <ide> public function styleText(string $text): string <ide> /** <ide> * Replace tags with color codes. <ide> * <del> * @param array $matches An array of matches to replace. <add> * @param array<string, string> $matches An array of matches to replace. <ide> * @return string <ide> */ <ide> protected function _replaceTags(array $matches): string <ide><path>src/Console/HelpFormatter.php <ide> public function text(int $width = 72): string <ide> } <ide> <ide> $options = $parser->options(); <del> if (!empty($options)) { <add> if ($options) { <ide> $max = $this->_getMaxLength($options) + 8; <ide> $out[] = '<info>Options:</info>'; <ide> $out[] = ''; <ide> protected function _generateUsage(): string <ide> /** <ide> * Iterate over a collection and find the longest named thing. <ide> * <del> * @param array $collection The collection to find a max length of. <add> * @param array<\Cake\Console\ConsoleInputOption|\Cake\Console\ConsoleInputArgument|\Cake\Console\ConsoleInputSubcommand> $collection The collection to find a max length of. <ide> * @return int <ide> */ <ide> protected function _getMaxLength(array $collection): int <ide><path>src/Console/Helper.php <ide> abstract class Helper <ide> /** <ide> * Default config for this helper. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> abstract class Helper <ide> * Constructor. <ide> * <ide> * @param \Cake\Console\ConsoleIo $io The ConsoleIo instance to use. <del> * @param array $config The settings for this helper. <add> * @param array<string, mixed> $config The settings for this helper. <ide> */ <ide> public function __construct(ConsoleIo $io, array $config = []) <ide> { <ide><path>src/Console/HelperRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param string $class The classname to create. <ide> * @param string $alias The alias of the helper. <del> * @param array $config An array of settings to use for the helper. <add> * @param array<string, mixed> $config An array of settings to use for the helper. <ide> * @return \Cake\Console\Helper The constructed helper class. <ide> * @psalm-suppress MoreSpecificImplementedParamType <ide> */ <ide><path>src/Console/Shell.php <ide> public function shortPath(string $file): string <ide> * object has not already been loaded, it will be loaded and constructed. <ide> * <ide> * @param string $name The name of the helper to render <del> * @param array $settings Configuration data for the helper. <add> * @param array<string, mixed> $config Configuration data for the helper. <ide> * @return \Cake\Console\Helper The created helper instance. <ide> */ <del> public function helper(string $name, array $settings = []): Helper <add> public function helper(string $name, array $config = []): Helper <ide> { <del> return $this->_io->helper($name, $settings); <add> return $this->_io->helper($name, $config); <ide> } <ide> <ide> /** <ide><path>src/Console/TaskRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param string $class The classname to create. <ide> * @param string $alias The alias of the task. <del> * @param array $config An array of settings to use for the task. <add> * @param array<string, mixed> $config An array of settings to use for the task. <ide> * @return \Cake\Console\Shell The constructed task class. <ide> * @psalm-suppress MoreSpecificImplementedParamType <ide> */ <ide><path>src/Controller/Component.php <ide> class Component implements EventListenerInterface <ide> * <ide> * These are merged with user-provided config when the component is used. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> class Component implements EventListenerInterface <ide> * <ide> * @param \Cake\Controller\ComponentRegistry $registry A component registry <ide> * this component can use to lazy load its components. <del> * @param array $config Array of configuration settings. <add> * @param array<string, mixed> $config Array of configuration settings. <ide> */ <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> { <ide> public function getController(): Controller <ide> * Implement this method to avoid having to overwrite <ide> * the constructor and call parent. <ide> * <del> * @param array $config The configuration settings provided to this component. <add> * @param array<string, mixed> $config The configuration settings provided to this component. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/Controller/Component/AuthComponent.php <ide> class AuthComponent extends Component implements EventDispatcherInterface <ide> * Defaults to 'Controller.startup'. You can set it to 'Controller.initialize' <ide> * if you want the check to be done before controller's beforeFilter() is run. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'authenticate' => null, <ide> class AuthComponent extends Component implements EventDispatcherInterface <ide> /** <ide> * Initialize properties. <ide> * <del> * @param array $config The config data. <add> * @param array<string, mixed> $config The config data. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/Controller/Component/FlashComponent.php <ide> class FlashComponent extends Component <ide> /** <ide> * Default configuration <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'key' => 'flash', <ide><path>src/Controller/Component/FormProtectionComponent.php <ide> class FormProtectionComponent extends Component <ide> * failure. Must be a valid Closure. Unset by default in which case <ide> * exception is thrown on validation failure. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'validate' => true, <ide><path>src/Controller/Component/PaginatorComponent.php <ide> class PaginatorComponent extends Component <ide> * parameters. Modifying this list will allow users to have more influence <ide> * over pagination, be careful with what you permit. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'page' => 1, <ide><path>src/Controller/Component/RequestHandlerComponent.php <ide> class RequestHandlerComponent extends Component <ide> * - `viewClassMap` - Mapping between type and view classes. If undefined <ide> * JSON, XML, and AJAX will be mapped. Defining any types will omit the defaults. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'checkHttpCache' => true, <ide> class RequestHandlerComponent extends Component <ide> * Constructor. Parses the accepted content types accepted by the client using HTTP_ACCEPT <ide> * <ide> * @param \Cake\Controller\ComponentRegistry $registry ComponentRegistry object. <del> * @param array $config Array of config. <add> * @param array<string, mixed> $config Array of config. <ide> */ <ide> public function __construct(ComponentRegistry $registry, array $config = []) <ide> { <ide><path>src/Controller/Component/SecurityComponent.php <ide> class SecurityComponent extends Component <ide> * - `validatePost` - Whether to validate POST data. Set to false to disable <ide> * for data coming from 3rd party services, etc. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'blackHoleCallback' => null, <ide><path>src/Controller/ComponentRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param string $class The classname to create. <ide> * @param string $alias The alias of the component. <del> * @param array $config An array of config to use for the component. <add> * @param array<string, mixed> $config An array of config to use for the component. <ide> * @return \Cake\Controller\Component The constructed component class. <ide> * @psalm-suppress MoreSpecificImplementedParamType <ide> * @psalm-param class-string $class <ide><path>src/Controller/Controller.php <ide> public function components(?ComponentRegistry $components = null): ComponentRegi <ide> * Will result in a `Toolbar` property being set. <ide> * <ide> * @param string $name The name of the component to load. <del> * @param array $config The config for the component. <add> * @param array<string, mixed> $config The config for the component. <ide> * @return \Cake\Controller\Component <ide> * @throws \Exception <ide> */ <ide><path>src/Core/ObjectRegistry.php <ide> abstract class ObjectRegistry implements Countable, IteratorAggregate <ide> * All calls to the `Email` component would use `AliasedEmail` instead. <ide> * <ide> * @param string $name The name/class of the object to load. <del> * @param array $config Additional settings to use when loading the object. <add> * @param array<string, mixed> $config Additional settings to use when loading the object. <ide> * @return mixed <ide> * @psalm-return TObject <ide> * @throws \Exception If the class cannot be found. <ide> public function load(string $name, array $config = []) <ide> * logic dependent on the configuration. <ide> * <ide> * @param string $name The name of the alias in the registry. <del> * @param array $config The config data for the new instance. <add> * @param array<string, mixed> $config The config data for the new instance. <ide> * @return void <ide> * @throws \RuntimeException When a duplicate is found. <ide> */ <ide> abstract protected function _throwMissingClassError(string $class, ?string $plug <ide> * <ide> * @param object|string $class The class to build. <ide> * @param string $alias The alias of the object. <del> * @param array $config The Configuration settings for construction <add> * @param array<string, mixed> $config The Configuration settings for construction <ide> * @return object <ide> * @psalm-param TObject|string $class <ide> * @psalm-return TObject <ide><path>src/Core/PluginApplicationInterface.php <ide> interface PluginApplicationInterface extends EventDispatcherInterface <ide> * all plugin hooks enabled. <ide> * <ide> * @param \Cake\Core\PluginInterface|string $name The plugin name or plugin object. <del> * @param array $config The configuration data for the plugin if using a string for $name <add> * @param array<string, mixed> $config The configuration data for the plugin if using a string for $name <ide> * @return $this <ide> */ <ide> public function addPlugin($name, array $config = []); <ide><path>src/Core/PluginCollection.php <ide> public function get(string $name): PluginInterface <ide> * Create a plugin instance from a name/classname and configuration. <ide> * <ide> * @param string $name The plugin name or classname <del> * @param array $config Configuration options for the plugin. <add> * @param array<string, mixed> $config Configuration options for the plugin. <ide> * @return \Cake\Core\PluginInterface <ide> * @throws \Cake\Core\Exception\MissingPluginException When plugin instance could not be created. <ide> */ <ide><path>src/Database/Connection.php <ide> class Connection implements ConnectionInterface <ide> * If set to a string it will be used as the name of cache config to use. <ide> * - `cacheKeyPrefix` Custom prefix to use when generation cache keys. Defaults to connection name. <ide> * <del> * @param array $config Configuration array. <add> * @param array<string, mixed> $config Configuration array. <ide> */ <ide> public function __construct(array $config) <ide> { <ide> public function configName(): string <ide> * as a class name and will be instantiated. <ide> * <ide> * @param \Cake\Database\DriverInterface|string $driver The driver instance to use. <del> * @param array $config Config for a new driver. <add> * @param array<string, mixed> $config Config for a new driver. <ide> * @throws \Cake\Database\Exception\MissingDriverException When a driver class is missing. <ide> * @throws \Cake\Database\Exception\MissingExtensionException When a driver's PHP extension is missing. <ide> * @return $this <ide><path>src/Database/Driver.php <ide> abstract class Driver implements DriverInterface <ide> /** <ide> * Constructor <ide> * <del> * @param array $config The configuration for the driver. <add> * @param array<string, mixed> $config The configuration for the driver. <ide> * @throws \InvalidArgumentException <ide> */ <ide> public function __construct(array $config = []) <ide> public function __construct(array $config = []) <ide> * Establishes a connection to the database server <ide> * <ide> * @param string $dsn A Driver-specific PDO-DSN <del> * @param array $config configuration to be used for creating connection <add> * @param array<string, mixed> $config configuration to be used for creating connection <ide> * @return bool true on success <ide> */ <ide> protected function _connect(string $dsn, array $config): bool <ide><path>src/Database/Log/QueryLogger.php <ide> class QueryLogger extends BaseLog <ide> /** <ide> * Constructor. <ide> * <del> * @param array $config Configuration array <add> * @param array<string, mixed> $config Configuration array <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Database/Schema/Collection.php <ide> public function describe(string $name, array $options = []): TableSchemaInterfac <ide> * <ide> * @param string $stage The stage name. <ide> * @param string $name The table name. <del> * @param array $config The config data. <add> * @param array<string, mixed> $config The config data. <ide> * @param \Cake\Database\Schema\TableSchema $schema The table schema instance. <ide> * @return void <ide> * @throws \Cake\Database\Exception\DatabaseException on query failure. <ide><path>src/Database/Schema/SchemaDialect.php <ide> public function dropTableSql(TableSchema $schema): array <ide> /** <ide> * Generate the SQL to list the tables. <ide> * <del> * @param array $config The connection configuration to use for <add> * @param array<string, mixed> $config The connection configuration to use for <ide> * getting tables from. <ide> * @return array An array of (sql, params) to execute. <ide> */ <ide> abstract public function listTablesSql(array $config): array; <ide> * Generate the SQL to describe a table. <ide> * <ide> * @param string $tableName The table name to get information on. <del> * @param array $config The connection configuration. <add> * @param array<string, mixed> $config The connection configuration. <ide> * @return array An array of (sql, params) to execute. <ide> */ <ide> abstract public function describeColumnSql(string $tableName, array $config): array; <ide> abstract public function describeColumnSql(string $tableName, array $config): ar <ide> * Generate the SQL to describe the indexes in a table. <ide> * <ide> * @param string $tableName The table name to get information on. <del> * @param array $config The connection configuration. <add> * @param array<string, mixed> $config The connection configuration. <ide> * @return array An array of (sql, params) to execute. <ide> */ <ide> abstract public function describeIndexSql(string $tableName, array $config): array; <ide> abstract public function describeIndexSql(string $tableName, array $config): arr <ide> * Generate the SQL to describe the foreign keys in a table. <ide> * <ide> * @param string $tableName The table name to get information on. <del> * @param array $config The connection configuration. <add> * @param array<string, mixed> $config The connection configuration. <ide> * @return array An array of (sql, params) to execute. <ide> */ <ide> abstract public function describeForeignKeySql(string $tableName, array $config): array; <ide> abstract public function describeForeignKeySql(string $tableName, array $config) <ide> * Generate the SQL to describe table options <ide> * <ide> * @param string $tableName Table name. <del> * @param array $config The connection configuration. <add> * @param array<string, mixed> $config The connection configuration. <ide> * @return array SQL statements to get options for a table. <ide> */ <ide> public function describeOptionsSql(string $tableName, array $config): array <ide><path>src/Datasource/ConnectionRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param \Cake\Datasource\ConnectionInterface|callable|string $class The classname or object to make. <ide> * @param string $alias The alias of the object. <del> * @param array $config An array of settings to use for the datasource. <add> * @param array<string, mixed> $config An array of settings to use for the datasource. <ide> * @return \Cake\Datasource\ConnectionInterface A connection with the correct settings. <ide> */ <ide> protected function _create($class, string $alias, array $config) <ide><path>src/Datasource/Paginator.php <ide> class Paginator implements PaginatorInterface <ide> * parameters. Modifying this list will allow users to have more influence <ide> * over pagination, be careful with what you permit. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'page' => 1, <ide> protected function getAllowedParameters(): array <ide> /** <ide> * Shim method for reading the deprecated sortWhitelist or sortableFields options. <ide> * <del> * @param array $config The configuration data to coalesce and emit warnings on. <add> * @param array<string, mixed> $config The configuration data to coalesce and emit warnings on. <ide> * @return array<string>|null <ide> */ <ide> protected function getSortableFields(array $config): ?array <ide><path>src/Error/BaseErrorHandler.php <ide> abstract class BaseErrorHandler <ide> /** <ide> * Options to use for the Error handling. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'log' => true, <ide><path>src/Error/ConsoleErrorHandler.php <ide> class ConsoleErrorHandler extends BaseErrorHandler <ide> /** <ide> * Constructor <ide> * <del> * @param array $config Config options for the error handler. <add> * @param array<string, mixed> $config Config options for the error handler. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Error/Debugger.php <ide> class Debugger <ide> /** <ide> * Default configuration <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'outputMask' => [], <ide><path>src/Error/ErrorHandler.php <ide> class ErrorHandler extends BaseErrorHandler <ide> /** <ide> * Constructor <ide> * <del> * @param array $config The options for error handling. <add> * @param array<string, mixed> $config The options for error handling. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Error/ErrorLogger.php <ide> class ErrorLogger implements ErrorLoggerInterface <ide> * extend one of the listed exceptions will also not be logged. <ide> * - `trace` Should error logs include stack traces? <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'skipLog' => [], <ide> class ErrorLogger implements ErrorLoggerInterface <ide> /** <ide> * Constructor <ide> * <del> * @param array $config Config array. <add> * @param array<string, mixed> $config Config array. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Error/Middleware/ErrorHandlerMiddleware.php <ide> class ErrorHandlerMiddleware implements MiddlewareInterface <ide> * which returns a \Cake\Error\ExceptionRendererInterface instance. <ide> * Defaults to \Cake\Error\ExceptionRenderer <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'skipLog' => [], <ide><path>src/Http/BaseApplication.php <ide> public function addPlugin($name, array $config = []) <ide> * If it isn't available, ignore it. <ide> * <ide> * @param \Cake\Core\PluginInterface|string $name The plugin name or plugin object. <del> * @param array $config The configuration data for the plugin if using a string for $name <add> * @param array<string, mixed> $config The configuration data for the plugin if using a string for $name <ide> * @return $this <ide> */ <ide> public function addOptionalPlugin($name, array $config = []) <ide><path>src/Http/Client.php <ide> class Client implements ClientInterface <ide> /** <ide> * Default configuration for the client. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'adapter' => null, <ide> class Client implements ClientInterface <ide> * \Cake\Http\Client\Adapter\Stream. <ide> * - protocolVersion - The HTTP protocol version to use. Defaults to 1.1 <ide> * <del> * @param array $config Config options for scoped clients. <add> * @param array<string, mixed> $config Config options for scoped clients. <ide> * @throws \InvalidArgumentException <ide> */ <ide> public function __construct(array $config = []) <ide><path>src/Http/Cookie/Cookie.php <ide> protected static function dateTimeInstance($expires): ?DateTimeInterface <ide> * Create Cookie instance from "set-cookie" header string. <ide> * <ide> * @param string $cookie Cookie header string. <del> * @param array $defaults Default attributes. <add> * @param array<string, mixed> $defaults Default attributes. <ide> * @return static <del> * @see \Cake\Cookie\Cookie::setDefaults() <add> * @see \Cake\Http\Cookie\Cookie::setDefaults() <ide> */ <ide> public static function createFromHeaderString(string $cookie, array $defaults = []) <ide> { <ide><path>src/Http/Cookie/CookieCollection.php <ide> public function __construct(array $cookies = []) <ide> /** <ide> * Create a Cookie Collection from an array of Set-Cookie Headers <ide> * <del> * @param array $header The array of set-cookie header values. <del> * @param array $defaults The defaults attributes. <add> * @param array<string> $header The array of set-cookie header values. <add> * @param array<string, mixed> $defaults The defaults attributes. <ide> * @return static <ide> */ <ide> public static function createFromHeader(array $header, array $defaults = []) <ide><path>src/Http/FlashMessage.php <ide> class FlashMessage <ide> /** <ide> * Default configuration <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'key' => 'flash', <ide> class FlashMessage <ide> * Constructor <ide> * <ide> * @param \Cake\Http\Session $session Session instance. <del> * @param array $config Config array. <add> * @param array<string, mixed> $config Config array. <ide> * @see FlashMessage::set() For list of valid config keys. <ide> */ <ide> public function __construct(Session $session, array $config = []) <ide><path>src/Http/Middleware/CsrfProtectionMiddleware.php <ide> class CsrfProtectionMiddleware implements MiddlewareInterface <ide> /** <ide> * Constructor <ide> * <del> * @param array $config Config options. See $_config for valid keys. <add> * @param array<string, mixed> $config Config options. See $_config for valid keys. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Http/Middleware/HttpsEnforcerMiddleware.php <ide> class HttpsEnforcerMiddleware implements MiddlewareInterface <ide> * - `headers` - Array of response headers in case of redirect. <ide> * - `disableOnDebug` - Whether HTTPS check should be disabled when debug is on. Default `true`. <ide> * <del> * @var array <del> * @psalm-var array{redirect: bool, statusCode: int, headers: array, disableOnDebug: bool} <add> * @var array<string, mixed> <ide> */ <ide> protected $config = [ <ide> 'redirect' => true, <ide> class HttpsEnforcerMiddleware implements MiddlewareInterface <ide> /** <ide> * Constructor <ide> * <del> * @param array $config The options to use. <del> * @see self::$config <add> * @param array<string, mixed> $config The options to use. <add> * @see \Cake\Http\Middleware\HttpsEnforcerMiddleware::$config <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Http/Middleware/SessionCsrfProtectionMiddleware.php <ide> class SessionCsrfProtectionMiddleware implements MiddlewareInterface <ide> /** <ide> * Constructor <ide> * <del> * @param array $config Config options. See $_config for valid keys. <add> * @param array<string, mixed> $config Config options. See $_config for valid keys. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Http/ServerRequest.php <ide> class ServerRequest implements ServerRequestInterface <ide> * requests with put, patch or delete data. <ide> * - `session` An instance of a Session object <ide> * <del> * @param array $config An array of request data to create a request with. <add> * @param array<string, mixed> $config An array of request data to create a request with. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide> public function __construct(array $config = []) <ide> /** <ide> * Process the config/settings data into properties. <ide> * <del> * @param array $config The config data to use. <add> * @param array<string, mixed> $config The config data to use. <ide> * @return void <ide> */ <ide> protected function _setConfig(array $config): void <ide> protected function _setConfig(array $config): void <ide> * <ide> * `query` option is also updated based on URL's querystring. <ide> * <del> * @param array $config Config array. <add> * @param array<string, mixed> $config Config array. <ide> * @return array Update config. <ide> */ <ide> protected function processUrlOption(array $config): array <ide><path>src/Http/Session.php <ide> protected static function _defaultConfig(string $name) <ide> * the configuration array for the engine. You can set the `engine` key to an already <ide> * instantiated session handler object. <ide> * <del> * @param array $config The Configuration to apply to this session object <add> * @param array<string, mixed> $config The Configuration to apply to this session object <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Http/Session/CacheSession.php <ide> class CacheSession implements SessionHandlerInterface <ide> /** <ide> * Constructor. <ide> * <del> * @param array $config The configuration to use for this engine <add> * @param array<string, mixed> $config The configuration to use for this engine <ide> * It requires the key 'config' which is the name of the Cache config to use for <ide> * storing the session <ide> * @throws \InvalidArgumentException if the 'config' key is not provided <ide><path>src/Http/Session/DatabaseSession.php <ide> class DatabaseSession implements SessionHandlerInterface <ide> * Constructor. Looks at Session configuration information and <ide> * sets up the session model. <ide> * <del> * @param array $config The configuration for this engine. It requires the 'model' <add> * @param array<string, mixed> $config The configuration for this engine. It requires the 'model' <ide> * key to be present corresponding to the Table to use for managing the sessions. <ide> */ <ide> public function __construct(array $config = []) <ide><path>src/Log/Engine/ArrayLog.php <ide> class ArrayLog extends BaseLog <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'levels' => [], <ide><path>src/Log/Engine/BaseLog.php <ide> abstract class BaseLog extends AbstractLogger <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'levels' => [], <ide> abstract class BaseLog extends AbstractLogger <ide> /** <ide> * __construct method <ide> * <del> * @param array $config Configuration array <add> * @param array<string, mixed> $config Configuration array <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Log/Engine/ConsoleLog.php <ide> class ConsoleLog extends BaseLog <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'stream' => 'php://stderr', <ide> class ConsoleLog extends BaseLog <ide> * - `outputAs` integer or ConsoleOutput::[RAW|PLAIN|COLOR] <ide> * - `dateFormat` PHP date() format. <ide> * <del> * @param array $config Options for the FileLog, see above. <add> * @param array<string, mixed> $config Options for the FileLog, see above. <ide> * @throws \InvalidArgumentException <ide> */ <ide> public function __construct(array $config = []) <ide><path>src/Log/Engine/FileLog.php <ide> class FileLog extends BaseLog <ide> * is made. <ide> * - `dateFormat` PHP date() format. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'path' => null, <ide> class FileLog extends BaseLog <ide> /** <ide> * Sets protected properties based on config provided <ide> * <del> * @param array $config Configuration array <add> * @param array<string, mixed> $config Configuration array <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Log/Engine/SyslogLog.php <ide> class SyslogLog extends BaseLog <ide> * ]); <ide> * ``` <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'levels' => [], <ide><path>src/Log/Formatter/AbstractFormatter.php <ide> abstract class AbstractFormatter <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> ]; <ide> <ide> /** <del> * @param array $config Config options <add> * @param array<string, mixed> $config Config options <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Log/Formatter/DefaultFormatter.php <ide> class DefaultFormatter extends AbstractFormatter <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'dateFormat' => 'Y-m-d H:i:s', <ide> class DefaultFormatter extends AbstractFormatter <ide> ]; <ide> <ide> /** <del> * @param array $config Formatter config <add> * @param array<string, mixed> $config Formatter config <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Log/Formatter/JsonFormatter.php <ide> class JsonFormatter extends AbstractFormatter <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'dateFormat' => DATE_ATOM, <ide> 'flags' => JSON_UNESCAPED_UNICODE, <ide> ]; <ide> <ide> /** <del> * @param array $config Formatter config <add> * @param array<string, mixed> $config Formatter config <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Log/Formatter/LegacySyslogFormatter.php <ide> class LegacySyslogFormatter extends AbstractFormatter <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'format' => '%s: %s', <ide> ]; <ide> <ide> /** <del> * @param array $config Formatter config <add> * @param array<string, mixed> $config Formatter config <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Log/LogEngineRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param \Psr\Log\LoggerInterface|string $class The classname or object to make. <ide> * @param string $alias The alias of the object. <del> * @param array $config An array of settings to use for the logger. <add> * @param array<string, mixed> $config An array of settings to use for the logger. <ide> * @return \Psr\Log\LoggerInterface The constructed logger class. <ide> * @throws \RuntimeException when an object doesn't implement the correct interface. <ide> */ <ide><path>src/Mailer/AbstractTransport.php <ide> abstract class AbstractTransport <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> abstract public function send(Message $message): array; <ide> /** <ide> * Constructor <ide> * <del> * @param array $config Configuration options. <add> * @param array<string, mixed> $config Configuration options. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/Mailer/Email.php <ide> public function jsonSerialize(): array <ide> /** <ide> * Configures an email instance object from serialized config. <ide> * <del> * @param array $config Email configuration array. <add> * @param array<string, mixed> $config Email configuration array. <ide> * @return $this Configured email instance. <ide> */ <ide> public function createFromArray(array $config) <ide><path>src/Mailer/Message.php <ide> public function getPriority(): ?int <ide> /** <ide> * Sets the configuration for this instance. <ide> * <del> * @param array $config Config array. <add> * @param array<string, mixed> $config Config array. <ide> * @return $this <ide> */ <ide> public function setConfig(array $config) <ide> public function jsonSerialize(): array <ide> /** <ide> * Configures an email instance object from serialized config. <ide> * <del> * @param array $config Email configuration array. <add> * @param array<string, mixed> $config Email configuration array. <ide> * @return $this Configured email instance. <ide> */ <ide> public function createFromArray(array $config) <ide><path>src/Mailer/Transport/SmtpTransport.php <ide> class SmtpTransport extends AbstractTransport <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'host' => 'localhost', <ide><path>src/Mailer/TransportRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param \Cake\Mailer\AbstractTransport|string $class The classname or object to make. <ide> * @param string $alias The alias of the object. <del> * @param array $config An array of settings to use for the cache engine. <add> * @param array<string, mixed> $config An array of settings to use for the cache engine. <ide> * @return \Cake\Mailer\AbstractTransport The constructed transport class. <ide> * @throws \RuntimeException when an object doesn't implement the correct interface. <ide> */ <ide><path>src/Network/Socket.php <ide> class Socket <ide> /** <ide> * Default configuration settings for the socket connection <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'persistent' => false, <ide> class Socket <ide> /** <ide> * Constructor. <ide> * <del> * @param array $config Socket configuration, which will be merged with the base configuration <add> * @param array<string, mixed> $config Socket configuration, which will be merged with the base configuration <ide> * @see \Cake\Network\Socket::$_defaultConfig <ide> */ <ide> public function __construct(array $config = []) <ide><path>src/ORM/Association/Loader/SelectLoader.php <ide> protected function _extractFinder($finderData): array <ide> * If the required fields are missing, throws an exception. <ide> * <ide> * @param \Cake\ORM\Query $fetchQuery The association fetching query <del> * @param array $key The foreign key fields to check <add> * @param array<string> $key The foreign key fields to check <ide> * @return void <ide> * @throws \InvalidArgumentException <ide> */ <ide> protected function _subqueryFields(Query $query): array <ide> * <ide> * @param \Cake\ORM\Query $fetchQuery The query to get results from <ide> * @param array<string, mixed> $options The options passed to the eager loader <del> * @return array <add> * @return array<string, mixed> <ide> */ <ide> protected function _buildResultMap(Query $fetchQuery, array $options): array <ide> { <ide> protected function _buildResultMap(Query $fetchQuery, array $options): array <ide> * for injecting the eager loaded rows <ide> * <ide> * @param \Cake\ORM\Query $fetchQuery the Query used to fetch results <del> * @param array $resultMap an array with the foreignKey as keys and <add> * @param array<string, mixed> $resultMap an array with the foreignKey as keys and <ide> * the corresponding target table results as value. <ide> * @param array<string, mixed> $options The options passed to the eagerLoader method <ide> * @return \Closure <ide> protected function _resultInjector(Query $fetchQuery, array $resultMap, array $o <ide> * for injecting the eager loaded rows when the matching needs to <ide> * be done with multiple foreign keys <ide> * <del> * @param array $resultMap A keyed arrays containing the target table <add> * @param array<string, mixed> $resultMap A keyed arrays containing the target table <ide> * @param array<string> $sourceKeys An array with aliased keys to match <ide> * @param string $nestKey The key under which results should be nested <ide> * @return \Closure <ide><path>src/ORM/Association/Loader/SelectWithPivotLoader.php <ide> protected function _linkField(array $options) <ide> * <ide> * @param \Cake\ORM\Query $fetchQuery The query to get results from <ide> * @param array<string, mixed> $options The options passed to the eager loader <del> * @return array <add> * @return array<string, mixed> <ide> * @throws \RuntimeException when the association property is not part of the results set. <ide> */ <ide> protected function _buildResultMap(Query $fetchQuery, array $options): array <ide><path>src/ORM/Behavior.php <ide> class Behavior implements EventListenerInterface <ide> * <ide> * These are merged with user-provided configuration when the behavior is used. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> class Behavior implements EventListenerInterface <ide> * Merges config with the default and store in the config property <ide> * <ide> * @param \Cake\ORM\Table $table The table this behavior is attached to. <del> * @param array $config The config for this behavior. <add> * @param array<string, mixed> $config The config for this behavior. <ide> */ <ide> public function __construct(Table $table, array $config = []) <ide> { <ide> public function __construct(Table $table, array $config = []) <ide> * Implement this method to avoid having to overwrite <ide> * the constructor and call parent. <ide> * <del> * @param array $config The configuration settings provided to this behavior. <add> * @param array<string, mixed> $config The configuration settings provided to this behavior. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide> public function table(): Table <ide> * Removes aliased methods that would otherwise be duplicated by userland configuration. <ide> * <ide> * @param string $key The key to filter. <del> * @param array $defaults The default method mappings. <del> * @param array $config The customized method mappings. <add> * @param array<string, mixed> $defaults The default method mappings. <add> * @param array<string, mixed> $config The customized method mappings. <ide> * @return array A de-duped list of config data. <ide> */ <ide> protected function _resolveMethodAliases(string $key, array $defaults, array $config): array <ide><path>src/ORM/Behavior/CounterCacheBehavior.php <ide> protected function _processAssociations(EventInterface $event, EntityInterface $ <ide> * @param \Cake\Event\EventInterface $event Event instance. <ide> * @param \Cake\Datasource\EntityInterface $entity Entity <ide> * @param \Cake\ORM\Association $assoc The association object <del> * @param array $settings The settings for for counter cache for this association <add> * @param array $settings The settings for counter cache for this association <ide> * @return void <ide> * @throws \RuntimeException If invalid callable is passed. <ide> */ <ide> protected function _shouldUpdateCount(array $conditions) <ide> /** <ide> * Fetches and returns the count for a single field in an association <ide> * <del> * @param array $config The counter cache configuration for a single field <add> * @param array<string, mixed> $config The counter cache configuration for a single field <ide> * @param array $conditions Additional conditions given to the query <ide> * @return int The number of relations matching the given config and conditions <ide> */ <ide><path>src/ORM/Behavior/TimestampBehavior.php <ide> class TimestampBehavior extends Behavior <ide> * the code is executed, to set to an explicit date time value - set refreshTimetamp to false <ide> * and call setTimestamp() on the behavior class before use. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'implementedFinders' => [], <ide> class TimestampBehavior extends Behavior <ide> * If events are specified - do *not* merge them with existing events, <ide> * overwrite the events to listen on <ide> * <del> * @param array $config The config for this behavior. <add> * @param array<string, mixed> $config The config for this behavior. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/ORM/Behavior/Translate/EavStrategy.php <ide> class EavStrategy implements TranslateStrategyInterface <ide> * <ide> * These are merged with user-provided configuration. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'fields' => [], <ide> class EavStrategy implements TranslateStrategyInterface <ide> * Constructor <ide> * <ide> * @param \Cake\ORM\Table $table The table this strategy is attached to. <del> * @param array $config The config for this strategy. <add> * @param array<string, mixed> $config The config for this strategy. <ide> */ <ide> public function __construct(Table $table, array $config = []) <ide> { <ide><path>src/ORM/Behavior/Translate/ShadowTableStrategy.php <ide> class ShadowTableStrategy implements TranslateStrategyInterface <ide> * <ide> * These are merged with user-provided configuration. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'fields' => [], <ide> class ShadowTableStrategy implements TranslateStrategyInterface <ide> * Constructor <ide> * <ide> * @param \Cake\ORM\Table $table Table instance. <del> * @param array $config Configuration. <add> * @param array<string, mixed> $config Configuration. <ide> */ <ide> public function __construct(Table $table, array $config = []) <ide> { <ide> protected function setupHasOneAssociation(string $locale, ArrayObject $options): <ide> * add the locale field though. <ide> * <ide> * @param \Cake\ORM\Query $query The query to check. <del> * @param array $config The config to use for adding fields. <add> * @param array<string, mixed> $config The config to use for adding fields. <ide> * @return bool Whether a join to the translation table is required. <ide> */ <ide> protected function addFieldsToQuery($query, array $config) <ide> protected function addFieldsToQuery($query, array $config) <ide> * <ide> * @param \Cake\ORM\Query $query the query to check. <ide> * @param string $name The clause name. <del> * @param array $config The config to use for adding fields. <add> * @param array<string, mixed> $config The config to use for adding fields. <ide> * @return bool Whether a join to the translation table is required. <ide> */ <ide> protected function iterateClause($query, $name = '', $config = []): bool <ide> function ($c, &$field) use ($fields, $alias, $mainTableAlias, $mainTableFields, <ide> * <ide> * @param \Cake\ORM\Query $query the query to check. <ide> * @param string $name The clause name. <del> * @param array $config The config to use for adding fields. <add> * @param array<string, mixed> $config The config to use for adding fields. <ide> * @return bool Whether a join to the translation table is required. <ide> */ <ide> protected function traverseClause($query, $name = '', $config = []): bool <ide><path>src/ORM/Behavior/TranslateBehavior.php <ide> class TranslateBehavior extends Behavior implements PropertyMarshalInterface <ide> * <ide> * These are merged with user-provided configuration when the behavior is used. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'implementedFinders' => ['translations' => 'findTranslations'], <ide> class TranslateBehavior extends Behavior implements PropertyMarshalInterface <ide> * are created/modified. Default `null`. <ide> * <ide> * @param \Cake\ORM\Table $table The table this behavior is attached to. <del> * @param array $config The config for this behavior. <add> * @param array<string, mixed> $config The config for this behavior. <ide> */ <ide> public function __construct(Table $table, array $config = []) <ide> { <ide> public function __construct(Table $table, array $config = []) <ide> /** <ide> * Initialize hook <ide> * <del> * @param array $config The config for this behavior. <add> * @param array<string, mixed> $config The config for this behavior. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/ORM/Behavior/TreeBehavior.php <ide> class TreeBehavior extends Behavior <ide> * <ide> * These are merged with user-provided configuration when the behavior is used. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'implementedFinders' => [ <ide><path>src/ORM/BehaviorRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param string $class The classname that is missing. <ide> * @param string $alias The alias of the object. <del> * @param array $config An array of config to use for the behavior. <add> * @param array<string, mixed> $config An array of config to use for the behavior. <ide> * @return \Cake\ORM\Behavior The constructed behavior class. <ide> * @psalm-suppress MoreSpecificImplementedParamType <ide> */ <ide><path>src/ORM/EagerLoadable.php <ide> class EagerLoadable <ide> * The keys maps to the settable properties in this class. <ide> * <ide> * @param string $name The Association name. <del> * @param array $config The list of properties to set. <add> * @param array<string, mixed> $config The list of properties to set. <ide> */ <ide> public function __construct(string $name, array $config = []) <ide> { <ide> public function canBeJoined(): bool <ide> * Sets the list of options to pass to the association object for loading <ide> * the records. <ide> * <del> * @param array $config The value to set. <add> * @param array<string, mixed> $config The value to set. <ide> * @return $this <ide> */ <ide> public function setConfig(array $config) <ide><path>src/ORM/EagerLoader.php <ide> public function externalAssociations(Table $repository): array <ide> * @param \Cake\ORM\Table $parent owning side of the association <ide> * @param string $alias name of the association to be loaded <ide> * @param array<string, mixed> $options list of extra options to use for this association <del> * @param array $paths An array with two values, the first one is a list of dot <add> * @param array<string, mixed> $paths An array with two values, the first one is a list of dot <ide> * separated strings representing associations that lead to this `$alias` in the <ide> * chain of associations to be loaded. The second value is the path to follow in <ide> * entities' properties to fetch a record of the corresponding association. <ide><path>src/ORM/Rule/LinkConstraint.php <ide> public function __invoke(EntityInterface $entity, array $options): bool <ide> /** <ide> * Alias fields. <ide> * <del> * @param array $fields The fields that should be aliased. <add> * @param array<string> $fields The fields that should be aliased. <ide> * @param \Cake\ORM\Table $source The object to use for aliasing. <ide> * @return array The aliased fields <ide> */ <ide><path>src/ORM/Table.php <ide> class Table implements RepositoryInterface, EventListenerInterface, EventDispatc <ide> * validation set, or an associative array, where key is the name of the <ide> * validation set and value the Validator instance. <ide> * <del> * @param array $config List of options for this table <add> * @param array<string, mixed> $config List of options for this table <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide> public static function defaultConnectionName(): string <ide> * } <ide> * ``` <ide> * <del> * @param array $config Configuration options passed to the constructor <add> * @param array<string, mixed> $config Configuration options passed to the constructor <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/Routing/Route/Route.php <ide> public function getMiddleware(): array <ide> * This method helps for applications that want to implement <ide> * router caching. <ide> * <del> * @param array $fields Key/Value of object attributes <add> * @param array<string, mixed> $fields Key/Value of object attributes <ide> * @return static A new instance of the route <ide> */ <ide> public static function __set_state(array $fields) <ide><path>src/Shell/Helper/TableHelper.php <ide> class TableHelper extends Helper <ide> /** <ide> * Default config for this helper. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'headers' => true, <ide><path>src/Shell/Task/CommandTask.php <ide> public function getShellList() <ide> /** <ide> * Find shells in $path and add them to $shellList <ide> * <del> * @param array $shellList The shell listing array. <add> * @param array<string, mixed> $shellList The shell listing array. <ide> * @param string $path The path to look in. <ide> * @param string $key The key to add shells to <ide> * @param array<string> $skip A list of commands to exclude. <ide> protected function _findShells(array $shellList, string $path, string $key, arra <ide> * <ide> * @param string $type The type of object. <ide> * @param array<string> $shells The shell names. <del> * @param array $shellList List of shells. <add> * @param array<string, mixed> $shellList List of shells. <ide> * @param array<string> $skip List of command names to skip. <ide> * @return array The updated $shellList <ide> */ <ide><path>src/TestSuite/Fixture/SchemaLoader.php <ide> class SchemaLoader <ide> protected $io; <ide> <ide> /** <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'dropTables' => true, <ide><path>src/TestSuite/HttpClientTrait.php <ide> public function cleanupMockResponses(): void <ide> * Create a new response. <ide> * <ide> * @param int $code The response code to use. Defaults to 200 <del> * @param array $headers A list of headers for the response. Example `Content-Type: application/json` <add> * @param array<string> $headers A list of headers for the response. Example `Content-Type: application/json` <ide> * @param string $body The body for the response. <ide> * @return \Cake\Http\Client\Response <ide> */ <ide><path>src/TestSuite/MiddlewareDispatcher.php <ide> protected function resolveRoute(array $url): string <ide> /** <ide> * Create a PSR7 request from the request spec. <ide> * <del> * @param array $spec The request spec. <add> * @param array<string, mixed> $spec The request spec. <ide> * @return \Cake\Http\ServerRequest <ide> */ <ide> protected function _createRequest(array $spec): ServerRequest <ide> protected function _createRequest(array $spec): ServerRequest <ide> /** <ide> * Run a request and get the response. <ide> * <del> * @param array $requestSpec The request spec to execute. <add> * @param array<string, mixed> $requestSpec The request spec to execute. <ide> * @return \Psr\Http\Message\ResponseInterface The generated response. <ide> * @throws \LogicException <ide> */ <ide><path>src/TestSuite/TestCase.php <ide> public function loadRoutes(?array $appArgs = null): void <ide> * Useful to test how plugins being loaded/not loaded interact with other <ide> * elements in CakePHP or applications. <ide> * <del> * @param array $plugins List of Plugins to load. <add> * @param array<string, mixed> $plugins List of Plugins to load. <ide> * @return \Cake\Http\BaseApplication <ide> */ <ide> public function loadPlugins(array $plugins = []): BaseApplication <ide> public function assertHtml(array $expected, string $string, bool $fullDebug = fa <ide> * <ide> * @param array $assertions Assertions to run. <ide> * @param string $string The HTML string to check. <del> * @param bool $fullDebug Whether or not more verbose output should be used. <add> * @param bool $fullDebug Whether more verbose output should be used. <ide> * @param array|string $regex Full regexp from `assertHtml` <ide> * @return string|false <ide> */ <ide><path>src/Utility/MergeVariablesTrait.php <ide> protected function _mergeVars(array $properties, array $options = []): void <ide> * Merge a single property with the values declared in all parent classes. <ide> * <ide> * @param string $property The name of the property being merged. <del> * @param array $parentClasses An array of classes you want to merge with. <add> * @param array<string> $parentClasses An array of classes you want to merge with. <ide> * @param array<string, mixed> $options Options for merging the property, see _mergeVars() <ide> * @return void <ide> */ <ide><path>src/Validation/Validator.php <ide> public function notEmptyDateTime(string $field, ?string $message = null, $when = <ide> * Converts validator to fieldName => $settings array <ide> * <ide> * @param string|int $fieldName name of field <del> * @param array $defaults default settings <del> * @param array|string $settings settings from data <add> * @param array<string, mixed> $defaults default settings <add> * @param array<string, mixed>|string $settings settings from data <ide> * @return array<array> <ide> * @throws \InvalidArgumentException <ide> */ <ide> public function containsNonAlphaNumeric(string $field, int $limit = 1, ?string $ <ide> * Add a date format validation rule to a field. <ide> * <ide> * @param string $field The field you want to apply the rule to. <del> * @param array $formats A list of accepted date formats. <add> * @param array<string> $formats A list of accepted date formats. <ide> * @param string|null $message The error message when the rule fails. <ide> * @param callable|string|null $when Either 'create' or 'update' or a callable that returns <ide> * true when the validation rule should be applied. <ide> public function date(string $field, array $formats = ['ymd'], ?string $message = <ide> * Add a date time format validation rule to a field. <ide> * <ide> * @param string $field The field you want to apply the rule to. <del> * @param array $formats A list of accepted date formats. <add> * @param array<string> $formats A list of accepted date formats. <ide> * @param string|null $message The error message when the rule fails. <ide> * @param callable|string|null $when Either 'create' or 'update' or a callable that returns <ide> * true when the validation rule should be applied. <ide><path>src/View/Cell.php <ide> abstract class Cell implements EventDispatcherInterface <ide> * Override this property in subclasses to allow <ide> * which options you want set as properties in your Cell. <ide> * <del> * @var array <add> * @var array<string> <ide> */ <ide> protected $_validCellOptions = []; <ide> <ide> abstract class Cell implements EventDispatcherInterface <ide> * @param \Cake\Http\ServerRequest $request The request to use in the cell. <ide> * @param \Cake\Http\Response $response The response to use in the cell. <ide> * @param \Cake\Event\EventManagerInterface $eventManager The eventManager to bind events to. <del> * @param array $cellOptions Cell options to apply. <add> * @param array<string, mixed> $cellOptions Cell options to apply. <ide> */ <ide> public function __construct( <ide> ServerRequest $request, <ide><path>src/View/Helper.php <ide> class Helper implements EventListenerInterface <ide> /** <ide> * Default config for this helper. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> class Helper implements EventListenerInterface <ide> * Default Constructor <ide> * <ide> * @param \Cake\View\View $view The View this helper is being attached to. <del> * @param array $config Configuration settings for the helper. <add> * @param array<string, mixed> $config Configuration settings for the helper. <ide> */ <ide> public function __construct(View $view, array $config = []) <ide> { <ide> public function implementedEvents(): array <ide> * <ide> * Implement this method to avoid having to overwrite the constructor and call parent. <ide> * <del> * @param array $config The configuration settings provided to this helper. <add> * @param array<string, mixed> $config The configuration settings provided to this helper. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/View/Helper/BreadcrumbsHelper.php <ide> class BreadcrumbsHelper extends Helper <ide> /** <ide> * Default config for the helper. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'templates' => [ <ide> public function reset() <ide> /** <ide> * Renders the breadcrumbs trail. <ide> * <del> * @param array $attributes Array of attributes applied to the `wrapper` template. Accepts the `templateVars` key to <add> * @param array<string, mixed> $attributes Array of attributes applied to the `wrapper` template. Accepts the `templateVars` key to <ide> * allow the insertion of custom template variable in the template. <del> * @param array $separator Array of attributes for the `separator` template. <add> * @param array<string, mixed> $separator Array of attributes for the `separator` template. <ide> * Possible properties are : <ide> * <ide> * - *separator* The string to be displayed as a separator <ide><path>src/View/Helper/FormHelper.php <ide> class FormHelper extends Helper <ide> /** <ide> * Default config for the helper. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'idPrefix' => null, <ide> class FormHelper extends Helper <ide> * Construct the widgets and binds the default context providers <ide> * <ide> * @param \Cake\View\View $view The View this helper is being attached to. <del> * @param array $config Configuration settings for the helper. <add> * @param array<string, mixed> $config Configuration settings for the helper. <ide> */ <ide> public function __construct(View $view, array $config = []) <ide> { <ide><path>src/View/Helper/HtmlHelper.php <ide> class HtmlHelper extends Helper <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'templates' => [ <ide><path>src/View/Helper/NumberHelper.php <ide> class NumberHelper extends Helper <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'engine' => Number::class, <ide> class NumberHelper extends Helper <ide> * The class needs to be placed in the `Utility` directory. <ide> * <ide> * @param \Cake\View\View $view The View this helper is being attached to. <del> * @param array $config Configuration settings for the helper <add> * @param array<string, mixed> $config Configuration settings for the helper <ide> * @throws \Cake\Core\Exception\CakeException When the engine class could not be found. <ide> */ <ide> public function __construct(View $view, array $config = []) <ide><path>src/View/Helper/PaginatorHelper.php <ide> class PaginatorHelper extends Helper <ide> * <ide> * Templates: the templates used by this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'options' => [], <ide> class PaginatorHelper extends Helper <ide> * Constructor. Overridden to merge passed args with URL options. <ide> * <ide> * @param \Cake\View\View $view The View this helper is being attached to. <del> * @param array $config Configuration settings for the helper. <add> * @param array<string, mixed> $config Configuration settings for the helper. <ide> */ <ide> public function __construct(View $view, array $config = []) <ide> { <ide> public function sort(string $key, $title = null, array $options = []): string <ide> * @param array<string, mixed> $options Pagination options. <ide> * @param string|null $model Which model to paginate on <ide> * @param array $url URL. <del> * @param array $urlOptions Array of options <add> * @param array<string, mixed> $urlOptions Array of options <ide> * @return string By default, returns a full pagination URL string for use <ide> * in non-standard contexts (i.e. JavaScript) <ide> * @link https://book.cakephp.org/4/en/views/helpers/paginator.html#generating-pagination-urls <ide> public function implementedEvents(): array <ide> * Dropdown select for pagination limit. <ide> * This will generate a wrapping form. <ide> * <del> * @param array $limits The options array. <add> * @param array<string, string> $limits The options array. <ide> * @param int|null $default Default option for pagination limit. Defaults to `$this->param('perPage')`. <ide> * @param array<string, mixed> $options Options for Select tag attributes like class, id or event <ide> * @return string html output. <ide><path>src/View/Helper/TextHelper.php <ide> class TextHelper extends Helper <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'engine' => Text::class, <ide> class TextHelper extends Helper <ide> * The class needs to be placed in the `Utility` directory. <ide> * <ide> * @param \Cake\View\View $view the view object the helper is attached to. <del> * @param array $config Settings array Settings array <add> * @param array<string, mixed> $config Settings array Settings array <ide> * @throws \Cake\Core\Exception\CakeException when the engine class could not be found. <ide> */ <ide> public function __construct(View $view, array $config = []) <ide><path>src/View/Helper/TimeHelper.php <ide> class TimeHelper extends Helper <ide> /** <ide> * Config options <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'outputTimezone' => null, <ide><path>src/View/Helper/UrlHelper.php <ide> class UrlHelper extends Helper <ide> /** <ide> * Default config for this class <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = [ <ide> 'assetUrlClassName' => Asset::class, <ide> class UrlHelper extends Helper <ide> /** <ide> * Check proper configuration <ide> * <del> * @param array $config The configuration settings provided to this helper. <add> * @param array<string, mixed> $config The configuration settings provided to this helper. <ide> * @return void <ide> */ <ide> public function initialize(array $config): void <ide><path>src/View/HelperRegistry.php <ide> protected function _throwMissingClassError(string $class, ?string $plugin): void <ide> * <ide> * @param string $class The class to create. <ide> * @param string $alias The alias of the loaded helper. <del> * @param array $config An array of settings to use for the helper. <add> * @param array<string, mixed> $config An array of settings to use for the helper. <ide> * @return \Cake\View\Helper The constructed helper class. <ide> * @psalm-suppress MoreSpecificImplementedParamType <ide> */ <ide><path>src/View/StringTemplate.php <ide> class StringTemplate <ide> /** <ide> * The default templates this instance holds. <ide> * <del> * @var array <add> * @var array<string, mixed> <ide> */ <ide> protected $_defaultConfig = []; <ide> <ide> class StringTemplate <ide> /** <ide> * Constructor. <ide> * <del> * @param array $config A set of templates to add. <add> * @param array<string, mixed> $config A set of templates to add. <ide> */ <ide> public function __construct(array $config = []) <ide> { <ide><path>src/View/View.php <ide> public function helpers(): HelperRegistry <ide> * Loads a helper. Delegates to the `HelperRegistry::load()` to load the helper <ide> * <ide> * @param string $name Name of the helper to load. <del> * @param array $config Settings for the helper <add> * @param array<string, mixed> $config Settings for the helper <ide> * @return \Cake\View\Helper a constructed helper object. <ide> * @see \Cake\View\HelperRegistry::load() <ide> */ <ide><path>src/View/ViewBuilder.php <ide> protected function _checkViewVars(&$item, string $key): void <ide> /** <ide> * Configures a view builder instance from serialized config. <ide> * <del> * @param array $config View builder configuration array. <add> * @param array<string, mixed> $config View builder configuration array. <ide> * @return $this Configured view builder instance. <ide> */ <ide> public function createFromArray(array $config) <ide><path>src/View/Widget/MultiCheckboxWidget.php <ide> protected function _renderInputs(array $data, ContextInterface $context): array <ide> /** <ide> * Render a single checkbox & wrapper. <ide> * <del> * @param array $checkbox An array containing checkbox key/value option pairs <add> * @param array<string, mixed> $checkbox An array containing checkbox key/value option pairs <ide> * @param \Cake\View\Form\ContextInterface $context Context object. <ide> * @return string <ide> */ <ide><path>src/View/Widget/RadioWidget.php <ide> public function render(array $data, ContextInterface $context): string <ide> /** <ide> * Disabled attribute detection. <ide> * <del> * @param array $radio Radio info. <add> * @param array<string, mixed> $radio Radio info. <ide> * @param array|true|null $disabled The disabled values. <ide> * @return bool <ide> */ <ide> protected function _renderInput($val, $text, $data, $context): string <ide> * In the future this might be refactored into a separate widget as other <ide> * input types (multi-checkboxes) will also need labels generated. <ide> * <del> * @param array $radio The input properties. <del> * @param array|string|false $label The properties for a label. <add> * @param array<string, mixed> $radio The input properties. <add> * @param array<string, mixed>|string|false $label The properties for a label. <ide> * @param string $input The input widget. <ide> * @param \Cake\View\Form\ContextInterface $context The form context. <del> * @param bool $escape Whether or not to HTML escape the label. <add> * @param bool $escape Whether to HTML escape the label. <ide> * @return string|false Generated label. <ide> */ <ide> protected function _renderLabel(array $radio, $label, $input, $context, $escape) <ide><path>tests/test_app/TestApp/Auth/TestAuthenticate.php <ide> public function implementedEvents(): array <ide> } <ide> <ide> /** <del> * @return array <add> * @return array<string, mixed> <ide> */ <ide> public function authenticate(ServerRequest $request, Response $response): array <ide> { <ide><path>tests/test_app/TestApp/View/Cell/ArticlesCell.php <ide> class ArticlesCell extends Cell <ide> /** <ide> * valid cell options. <ide> * <del> * @var array <add> * @var array<string> <ide> */ <ide> protected $_validCellOptions = ['limit', 'page']; <ide>
121
Java
Java
remove jmxmp from testgroup
bd414df9443f0bdda7681f32a1141b8041c8518d
<ide><path>spring-context/src/test/java/org/springframework/jmx/AbstractMBeanServerTests.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.context.ConfigurableApplicationContext; <ide> import org.springframework.context.support.GenericApplicationContext; <ide> import org.springframework.jmx.export.MBeanExporter; <del>import org.springframework.tests.TestGroup; <ide> import org.springframework.util.MBeanTestUtils; <ide> <ide> import static org.junit.Assert.*; <ide> <ide> /** <del> * <strong>Note:</strong> certain tests throughout this hierarchy require the presence of <del> * the {@code jmxremote_optional.jar} in your classpath. For this reason, these tests are <del> * run only if {@link TestGroup#JMXMP} is enabled. <del> * <del> * <p>If you wish to run these tests, follow the instructions in the TestGroup class to <del> * enable JMXMP tests (i.e., set the following Java system property: <del> * {@code -DtestGroups=jmxmp}). <del> * <ide> * <p>If you run into the <em>"Unsupported protocol: jmxmp"</em> error, you will need to <ide> * download the <a href="https://www.oracle.com/technetwork/java/javase/tech/download-jsp-141676.html">JMX <ide> * Remote API 1.0.1_04 Reference Implementation</a> from Oracle and extract <ide> * <ide> * <p>See also: <ide> * <ul> <del> * <li> <ide> * <li><a href="https://jira.spring.io/browse/SPR-8093">SPR-8093</a></li> <ide> * <li><a href="https://issuetracker.springsource.com/browse/EBR-349">EBR-349</a></li> <ide> * </ul> <ide><path>spring-context/src/test/java/org/springframework/jmx/access/MBeanClientInterceptorTests.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.jmx.JmxTestBean; <ide> import org.springframework.jmx.export.MBeanExporter; <ide> import org.springframework.jmx.export.assembler.AbstractReflectiveMBeanInfoAssembler; <del>import org.springframework.tests.Assume; <del>import org.springframework.tests.TestGroup; <ide> import org.springframework.util.SocketUtils; <ide> <ide> import static org.junit.Assert.*; <ide> import static org.junit.Assume.*; <ide> <ide> /** <del> * To run the tests in the class, set the following Java system property: <del> * {@code -DtestGroups=jmxmp}. <del> * <ide> * @author Rob Harrop <ide> * @author Juergen Hoeller <ide> * @author Sam Brannen <ide> public void testInvokeUnexposedMethodWithException() throws Exception { <ide> @Test <ide> public void testTestLazyConnectionToRemote() throws Exception { <ide> assumeTrue(runTests); <del> Assume.group(TestGroup.JMXMP); <ide> <ide> final int port = SocketUtils.findAvailableTcpPort(); <ide> <ide><path>spring-context/src/test/java/org/springframework/jmx/access/RemoteMBeanClientInterceptorTests.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> import org.junit.After; <ide> <del>import org.springframework.tests.Assume; <del>import org.springframework.tests.TestGroup; <ide> import org.springframework.util.SocketUtils; <ide> <ide> /** <del> * To run the tests in the class, set the following Java system property: <del> * {@code -DtestGroups=jmxmp}. <del> * <ide> * @author Rob Harrop <ide> * @author Chris Beams <ide> * @author Sam Brannen <ide> public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTes <ide> <ide> @Override <ide> public void onSetUp() throws Exception { <del> runTests = false; <del> Assume.group(TestGroup.JMXMP); <del> runTests = true; <ide> super.onSetUp(); <ide> this.connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(getServiceUrl(), null, getServer()); <ide> try { <ide><path>spring-context/src/test/java/org/springframework/jmx/support/ConnectorServerFactoryBeanTests.java <ide> /* <del> * Copyright 2002-2016 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import javax.management.remote.JMXConnectorFactory; <ide> import javax.management.remote.JMXServiceURL; <ide> <del>import org.junit.After; <ide> import org.junit.Test; <ide> <ide> import org.springframework.jmx.AbstractMBeanServerTests; <del>import org.springframework.tests.Assume; <del>import org.springframework.tests.TestGroup; <ide> <ide> import static org.junit.Assert.*; <ide> <ide> /** <del> * To run the tests in the class, set the following Java system property: <del> * {@code -DtestGroups=jmxmp}. <del> * <ide> * @author Rob Harrop <ide> * @author Chris Beams <ide> * @author Sam Brannen <ide> public class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests { <ide> private static final String OBJECT_NAME = "spring:type=connector,name=test"; <ide> <ide> <del> @Override <del> protected void onSetUp() throws Exception { <del> Assume.group(TestGroup.JMXMP); <del> } <del> <del> @After <del> @Override <del> public void tearDown() throws Exception { <del> Assume.group(TestGroup.JMXMP, () -> super.tearDown()); <del> } <del> <del> <ide> @Test <ide> public void startupWithLocatedServer() throws Exception { <ide> ConnectorServerFactoryBean bean = new ConnectorServerFactoryBean(); <ide><path>spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java <ide> /* <del> * Copyright 2002-2015 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> import org.springframework.aop.support.AopUtils; <ide> import org.springframework.jmx.AbstractMBeanServerTests; <del>import org.springframework.tests.Assume; <del>import org.springframework.tests.TestGroup; <ide> import org.springframework.util.SocketUtils; <ide> <ide> import static org.junit.Assert.*; <ide> <ide> /** <del> * To run the tests in the class, set the following Java system property: <del> * {@code -DtestGroups=jmxmp}. <del> * <ide> * @author Rob Harrop <ide> * @author Juergen Hoeller <ide> * @author Sam Brannen <ide> */ <ide> public class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTests { <ide> <del> private final String serviceUrl; <add> private final String serviceUrl = "service:jmx:jmxmp://localhost:" + SocketUtils.findAvailableTcpPort(9800, 9900); <ide> <del> { <del> int port = SocketUtils.findAvailableTcpPort(9800, 9900); <del> this.serviceUrl = "service:jmx:jmxmp://localhost:" + port; <del> } <ide> <ide> private JMXServiceURL getJMXServiceUrl() throws MalformedURLException { <ide> return new JMXServiceURL(serviceUrl); <ide> private JMXConnectorServer getConnectorServer() throws Exception { <ide> <ide> @Test <ide> public void testTestValidConnection() throws Exception { <del> Assume.group(TestGroup.JMXMP); <ide> JMXConnectorServer connectorServer = getConnectorServer(); <ide> connectorServer.start(); <ide> <ide> public void testWithNoServiceUrl() throws Exception { <ide> <ide> @Test <ide> public void testTestWithLazyConnection() throws Exception { <del> Assume.group(TestGroup.JMXMP); <ide> MBeanServerConnectionFactoryBean bean = new MBeanServerConnectionFactoryBean(); <ide> bean.setServiceUrl(serviceUrl); <ide> bean.setConnectOnStartup(false); <ide><path>spring-core/src/test/java/org/springframework/tests/AssumeTests.java <ide> public void restoreOriginalTestGroups() { <ide> @Test <ide> public void assumeGroupWithNoActiveTestGroups() { <ide> setTestGroups(""); <del> Assume.group(JMXMP); <add> Assume.group(LONG_RUNNING); <ide> fail("assumption should have failed"); <ide> } <ide> <ide> @Test <ide> public void assumeGroupWithNoMatchingActiveTestGroup() { <ide> setTestGroups(PERFORMANCE, CI); <del> Assume.group(JMXMP); <add> Assume.group(LONG_RUNNING); <ide> fail("assumption should have failed"); <ide> } <ide> <ide> @Test <ide> public void assumeGroupWithMatchingActiveTestGroup() { <del> setTestGroups(JMXMP); <add> setTestGroups(LONG_RUNNING); <ide> try { <del> Assume.group(JMXMP); <add> Assume.group(LONG_RUNNING); <ide> } <ide> catch (AssumptionViolatedException ex) { <ide> fail("assumption should NOT have failed"); <ide> private void assertBogusActiveTestGroupBehavior(String testGroups) { <ide> <ide> setTestGroups(testGroups); <ide> try { <del> Assume.group(JMXMP); <add> Assume.group(LONG_RUNNING); <ide> fail("assumption should have failed"); <ide> } <ide> catch (IllegalStateException ex) { <ide> private void assertBogusActiveTestGroupBehavior(String testGroups) { <ide> assertThat(ex.getCause(), instanceOf(IllegalArgumentException.class)); <ide> assertThat(ex.getCause().getMessage(), <ide> equalTo("Unable to find test group 'bogus' when parsing testGroups value: '" + testGroups <del> + "'. Available groups include: [LONG_RUNNING,PERFORMANCE,JMXMP,CI]")); <add> + "'. Available groups include: [LONG_RUNNING,PERFORMANCE,CI]")); <ide> } <ide> } <ide> <ide><path>spring-core/src/test/java/org/springframework/tests/TestGroup.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public enum TestGroup { <ide> */ <ide> PERFORMANCE, <ide> <del> /** <del> * Tests requiring the presence of jmxremote_optional.jar in jre/lib/ext in order to <del> * avoid "Unsupported protocol: jmxmp" errors. <del> */ <del> JMXMP, <del> <ide> /** <ide> * Tests that should only be run on the continuous integration server. <ide> */ <ide><path>spring-core/src/test/java/org/springframework/tests/TestGroupTests.java <ide> /* <del> * Copyright 2002-2017 the original author or authors. <add> * Copyright 2002-2019 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> public void parseMissing() { <ide> thrown.expect(IllegalArgumentException.class); <ide> thrown.expectMessage("Unable to find test group 'missing' when parsing " + <ide> "testGroups value: 'performance, missing'. Available groups include: " + <del> "[LONG_RUNNING,PERFORMANCE,JMXMP,CI]"); <add> "[LONG_RUNNING,PERFORMANCE,CI]"); <ide> TestGroup.parse("performance, missing"); <ide> } <ide> <ide> public void parseAllExceptMissing() { <ide> thrown.expect(IllegalArgumentException.class); <ide> thrown.expectMessage("Unable to find test group 'missing' when parsing " + <ide> "testGroups value: 'all-missing'. Available groups include: " + <del> "[LONG_RUNNING,PERFORMANCE,JMXMP,CI]"); <add> "[LONG_RUNNING,PERFORMANCE,CI]"); <ide> TestGroup.parse("all-missing"); <ide> } <ide>
8
Go
Go
remove libcontainer dependency
b0b71dbe1cb9e4c06966328a5cd7b54ed0701581
<ide><path>pkg/sysinfo/cgroup2_linux.go <ide> import ( <ide> "path" <ide> "strings" <ide> <add> "github.com/containerd/cgroups" <ide> cgroupsV2 "github.com/containerd/cgroups/v2" <ide> "github.com/containerd/containerd/pkg/userns" <del> "github.com/opencontainers/runc/libcontainer/cgroups" <ide> "github.com/sirupsen/logrus" <ide> ) <ide> <ide><path>pkg/sysinfo/sysinfo_linux.go <ide> import ( <ide> "os" <ide> "path" <ide> "strings" <add> "sync" <ide> <del> cdcgroups "github.com/containerd/cgroups" <del> cdseccomp "github.com/containerd/containerd/pkg/seccomp" <del> "github.com/opencontainers/runc/libcontainer/cgroups" <add> "github.com/containerd/cgroups" <add> "github.com/containerd/containerd/pkg/seccomp" <add> "github.com/moby/sys/mountinfo" <ide> "github.com/sirupsen/logrus" <ide> ) <ide> <del>func findCgroupMountpoints() (map[string]string, error) { <del> cgMounts, err := cgroups.GetCgroupMounts(false) <add>var ( <add> readMountinfoOnce sync.Once <add> readMountinfoErr error <add> cgroupMountinfo []*mountinfo.Info <add>) <add> <add>// readCgroupMountinfo returns a list of cgroup v1 mounts (i.e. the ones <add>// with fstype of "cgroup") for the current running process. <add>// <add>// The results are cached (to avoid re-reading mountinfo which is relatively <add>// expensive), so it is assumed that cgroup mounts are not being changed. <add>func readCgroupMountinfo() ([]*mountinfo.Info, error) { <add> readMountinfoOnce.Do(func() { <add> cgroupMountinfo, readMountinfoErr = mountinfo.GetMounts( <add> mountinfo.FSTypeFilter("cgroup"), <add> ) <add> }) <add> <add> return cgroupMountinfo, readMountinfoErr <add>} <add> <add>func findCgroupV1Mountpoints() (map[string]string, error) { <add> mounts, err := readCgroupMountinfo() <add> if err != nil { <add> return nil, err <add> } <add> <add> allSubsystems, err := cgroups.ParseCgroupFile("/proc/self/cgroup") <ide> if err != nil { <ide> return nil, fmt.Errorf("Failed to parse cgroup information: %v", err) <ide> } <add> <add> allMap := make(map[string]bool) <add> for s := range allSubsystems { <add> allMap[s] = false <add> } <add> <ide> mps := make(map[string]string) <del> for _, m := range cgMounts { <del> for _, ss := range m.Subsystems { <del> mps[ss] = m.Mountpoint <add> for _, mi := range mounts { <add> for _, opt := range strings.Split(mi.VFSOptions, ",") { <add> seen, known := allMap[opt] <add> if known && !seen { <add> allMap[opt] = true <add> mps[strings.TrimPrefix(opt, "name=")] = mi.Mountpoint <add> } <add> } <add> if len(mps) >= len(allMap) { <add> break <ide> } <ide> } <ide> return mps, nil <ide> func WithCgroup2GroupPath(g string) Opt { <ide> // New returns a new SysInfo, using the filesystem to detect which features <ide> // the kernel supports. <ide> func New(options ...Opt) *SysInfo { <del> if cdcgroups.Mode() == cdcgroups.Unified { <add> if cgroups.Mode() == cgroups.Unified { <ide> return newV2(options...) <ide> } <ide> return newV1() <ide> func newV1() *SysInfo { <ide> applyCgroupNsInfo, <ide> } <ide> <del> sysInfo.cgMounts, err = findCgroupMountpoints() <add> sysInfo.cgMounts, err = findCgroupV1Mountpoints() <ide> if err != nil { <ide> logrus.Warn(err) <ide> } else { <ide> func applyCgroupNsInfo(info *SysInfo) { <ide> <ide> // applySeccompInfo checks if Seccomp is supported, via CONFIG_SECCOMP. <ide> func applySeccompInfo(info *SysInfo) { <del> info.Seccomp = cdseccomp.IsEnabled() <add> info.Seccomp = seccomp.IsEnabled() <ide> } <ide> <ide> func cgroupEnabled(mountPoint, name string) bool {
2
Javascript
Javascript
fix cachewithcontext inversion
8fcd251a7f2220737ebd27b363713fbe9350cd82
<ide><path>lib/cache/ResolverCachePlugin.js <ide> class ResolverCachePlugin { <ide> } <ide> const identifier = `/resolve/${type}${optionsIdent}${objectToString( <ide> request, <del> cacheWithContext <add> !cacheWithContext <ide> )}`; <ide> const activeRequest = activeRequests.get(identifier); <ide> if (activeRequest) {
1
PHP
PHP
fix psalm failure
45b457d4cded0e569544461f62cfb994364af7ce
<ide><path>src/ORM/Table.php <ide> public function validateUnique($value, array $options, ?array $context = null): <ide> } <ide> } <ide> $class = static::IS_UNIQUE_CLASS; <add> /** @var \Cake\ORM\Rule\IsUnique $rule */ <ide> $rule = new $class($fields, $options); <ide> <ide> return $rule($entity, ['repository' => $this]);
1
Javascript
Javascript
add test for #591
f71943d63365319a3fce0b24d17e6d96a937987c
<ide><path>packages/ember-runtime/tests/system/object/subclasses_test.js <ide> test('defining sub-sub class should only go to parent', function() { <ide> ok(Sub.subclasses.contains(SubSub), 'Sub contains SubSub'); <ide> }); <ide> <add>// TEST lazy prototype and Em.rewatch(prototype) <add>test('chains should copy forward to subclasses when prototype created', function () { <add> var ObjectWithChains, objWithChains, SubWithChains, SubSub, subSub; <add> Ember.run(function () { <add> ObjectWithChains = Ember.Object.extend({ <add> obj: { <add> a: 'a', <add> hi: 'hi' <add> }, <add> aBinding: 'obj.a' // add chain <add> }); <add> // realize prototype <add> objWithChains = ObjectWithChains.create(); <add> // should not copy chains from parent yet <add> SubWithChains = ObjectWithChains.extend({ <add> hiBinding: 'obj.hi', // add chain <add> hello: Ember.computed(function() { <add> return this.getPath('obj.hi') + ' world'; <add> }).property('hi'), // observe chain <add> greetingBinding: 'hello' <add> }); <add> SubSub = SubWithChains.extend(); <add> // should realize prototypes and copy forward chains <add> subSub = SubSub.create(); <add> }); <add> equal(subSub.get('greeting'), 'hi world'); <add> Ember.run(function () { <add> objWithChains.setPath('obj.hi', 'hello'); <add> }); <add> equal(subSub.get('greeting'), 'hello world'); <add>});
1
Javascript
Javascript
turn sanitizer into a service
0f6b2ef9823953533dd98849fc29c08e6a05c4a4
<ide><path>angularFiles.js <ide> angularFiles = { <ide> 'src/JSON.js', <ide> 'src/Injector.js', <ide> 'src/Resource.js', <del> 'src/sanitizer.js', <ide> 'src/jqLite.js', <ide> 'src/apis.js', <ide> 'src/service/anchorScroll.js', <ide> angularFiles = { <ide> 'src/service/route.js', <ide> 'src/service/routeParams.js', <ide> 'src/service/scope.js', <add> 'src/service/sanitize.js', <ide> 'src/service/sniffer.js', <ide> 'src/service/window.js', <ide> 'src/service/http.js', <add><path>src/service/sanitize.js <del><path>src/sanitizer.js <ide> * <ide> */ <ide> <add> <add> <add>/** <add> * @ngdoc service <add> * @name angular.module.ng.$sanitize <add> * @function <add> * <add> * @description <add> * The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are <add> * then serialized back to properly escaped html string. This means that no unsafe input can make <add> * it into the returned string, however, since our parser is more strict than a typical browser <add> * parser, it's possible that some obscure input, which would be recognized as valid HTML by a <add> * browser, won't make it through the sanitizer. <add> * <add> * @param {string} html Html input. <add> * @returns {string} Sanitized html. <add> * <add> * @example <add> <doc:example> <add> <doc:source> <add> <script> <add> function Ctrl() { <add> this.snippet = <add> '<p style="color:blue">an html\n' + <add> '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' + <add> 'snippet</p>'; <add> } <add> </script> <add> <div ng:controller="Ctrl"> <add> Snippet: <textarea ng:model="snippet" cols="60" rows="3"></textarea> <add> <table> <add> <tr> <add> <td>Filter</td> <add> <td>Source</td> <add> <td>Rendered</td> <add> </tr> <add> <tr id="html-filter"> <add> <td>html filter</td> <add> <td> <add> <pre>&lt;div ng:bind-html="snippet"&gt;<br/>&lt;/div&gt;</pre> <add> </td> <add> <td> <add> <div ng:bind-html="snippet"></div> <add> </td> <add> </tr> <add> <tr id="escaped-html"> <add> <td>no filter</td> <add> <td><pre>&lt;div ng:bind-="snippet"&gt;<br/>&lt;/div&gt;</pre></td> <add> <td><div ng:bind="snippet"></div></td> <add> </tr> <add> <tr id="html-unsafe-filter"> <add> <td>unsafe html filter</td> <add> <td><pre>&lt;div ng:bind-html-unsafe="snippet"&gt;<br/>&lt;/div&gt;</pre></td> <add> <td><div ng:bind-html-unsafe="snippet"></div></td> <add> </tr> <add> </table> <add> </div> <add> </doc:source> <add> <doc:scenario> <add> it('should sanitize the html snippet ', function() { <add> expect(using('#html-filter').element('div').html()). <add> toBe('<p>an html\n<em>click here</em>\nsnippet</p>'); <add> }); <add> <add> it('should escape snippet without any filter', function() { <add> expect(using('#escaped-html').element('div').html()). <add> toBe("&lt;p style=\"color:blue\"&gt;an html\n" + <add> "&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\n" + <add> "snippet&lt;/p&gt;"); <add> }); <add> <add> it('should inline raw snippet if filtered as unsafe', function() { <add> expect(using('#html-unsafe-filter').element("div").html()). <add> toBe("<p style=\"color:blue\">an html\n" + <add> "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + <add> "snippet</p>"); <add> }); <add> <add> it('should update', function() { <add> input('snippet').enter('new <b>text</b>'); <add> expect(using('#html-filter').binding('snippet')).toBe('new <b>text</b>'); <add> expect(using('#escaped-html').element('div').html()).toBe("new &lt;b&gt;text&lt;/b&gt;"); <add> expect(using('#html-unsafe-filter').binding("snippet")).toBe('new <b>text</b>'); <add> }); <add> </doc:scenario> <add> </doc:example> <add> */ <add> <add>function $SanitizeProvider() { <add> this.$get = valueFn(function(html) { <add> var buf = []; <add> htmlParser(html, htmlSanitizeWriter(buf)); <add> return buf.join(''); <add> }); <add>}; <add> <ide> // Regular Expressions for parsing tags and attributes <ide> var START_TAG_REGEXP = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/, <ide> END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,
2
Text
Text
end sentences with a `.`. [ci skip]
64c784f5534bdd18866700f9441d99bcef568c3a
<ide><path>activerecord/CHANGELOG.md <ide> <ide> *Neeraj Singh* <ide> <del>* Removed deprecated method `scoped` <add>* Removed deprecated method `scoped`. <ide> <ide> *Neeraj Singh* <ide> <del>* Removed deprecated method `default_scopes?` <add>* Removed deprecated method `default_scopes?`. <ide> <ide> *Neeraj Singh* <ide> <ide> <ide> *Jon Leighton* <ide> <del>* Remove `activerecord-deprecated_finders` as a dependency <add>* Remove `activerecord-deprecated_finders` as a dependency. <ide> <ide> *Łukasz Strzałkowski* <ide> <ide><path>guides/source/4_1_release_notes.md <ide> for detailed changes. <ide> * Removed deprecated `threadsafe!` from Rails Config. <ide> <ide> * Removed deprecated `ActiveRecord::Generators::ActiveModel#update_attributes` in <del> favor of `ActiveRecord::Generators::ActiveModel#update` <add> favor of `ActiveRecord::Generators::ActiveModel#update`. <ide> <del>* Removed deprecated `config.whiny_nils` option <add>* Removed deprecated `config.whiny_nils` option. <ide> <ide> * Removed deprecated rake tasks for running tests: `rake test:uncommitted` and <ide> `rake test:recent`. <ide> for detailed changes. <ide> * `BACKTRACE` environment variable to show unfiltered backtraces for test <ide> failures. ([Commit](https://github.com/rails/rails/commit/84eac5dab8b0fe9ee20b51250e52ad7bfea36553)) <ide> <del>* Exposed `MiddlewareStack#unshift` to environment configuration. ([Pull Request](https://github.com/rails/rails/pull/12479)) <add>* Exposed `MiddlewareStack#unshift` to environment <add> configuration. ([Pull Request](https://github.com/rails/rails/pull/12479)) <ide> <del>* Add `Application#message_verifier` method to return a message verifier. ([Pull Request](https://github.com/rails/rails/pull/12995)) <add>* Add `Application#message_verifier` method to return a message <add> verifier. ([Pull Request](https://github.com/rails/rails/pull/12995)) <ide> <ide> Action Mailer <ide> ------------- <ide> for detailed changes. <ide> * Removed deprecated methods `partial_updates`, `partial_updates?` and <ide> `partial_updates=`. <ide> <del>* Removed deprecated method `scoped` <add>* Removed deprecated method `scoped`. <ide> <del>* Removed deprecated method `default_scopes?` <add>* Removed deprecated method `default_scopes?`. <ide> <ide> * Remove implicit join references that were deprecated in 4.0. <ide> <del>* Removed `activerecord-deprecated_finders` as a dependency <add>* Removed `activerecord-deprecated_finders` as a dependency. <ide> <ide> * Removed usage of `implicit_readonly`. Please use `readonly` method <ide> explicitly to mark records as <ide><path>railties/CHANGELOG.md <ide> *Paul Nikitochkin* <ide> <ide> * Remove deprecated `ActiveRecord::Generators::ActiveModel#update_attributes` in <del> favor of `ActiveRecord::Generators::ActiveModel#update` <add> favor of `ActiveRecord::Generators::ActiveModel#update`. <ide> <ide> *Vipul A M* <ide> <del>* Remove deprecated `config.whiny_nils` option <add>* Remove deprecated `config.whiny_nils` option. <ide> <ide> *Vipul A M* <ide>
3
Ruby
Ruby
move helper class to the top
01da3593939ba6037a00f8eb9a2051b4b6f6f325
<ide><path>activerecord/lib/active_record/associations/join_dependency.rb <ide> class JoinDependency # :nodoc: <ide> autoload :JoinBase, 'active_record/associations/join_dependency/join_base' <ide> autoload :JoinAssociation, 'active_record/associations/join_dependency/join_association' <ide> <add> class Aliases # :nodoc: <add> def initialize(tables) <add> @tables = tables <add> @alias_cache = tables.each_with_object({}) { |table,h| <add> h[table.node] = table.columns.each_with_object({}) { |column,i| <add> i[column.name] = column.alias <add> } <add> } <add> @name_and_alias_cache = tables.each_with_object({}) { |table,h| <add> h[table.node] = table.columns.map { |column| <add> [column.name, column.alias] <add> } <add> } <add> end <add> <add> def columns <add> @tables.flat_map { |t| t.column_aliases } <add> end <add> <add> # An array of [column_name, alias] pairs for the table <add> def column_aliases(node) <add> @name_and_alias_cache[node] <add> end <add> <add> def column_alias(node, column) <add> @alias_cache[node][column] <add> end <add> <add> class Table < Struct.new(:node, :columns) <add> def table <add> Arel::Nodes::TableAlias.new node.table, node.aliased_table_name <add> end <add> <add> def column_aliases <add> t = table <add> columns.map { |column| t[column.name].as Arel.sql column.alias } <add> end <add> end <add> Column = Struct.new(:name, :alias) <add> end <add> <ide> attr_reader :alias_tracker, :base_klass, :join_root <ide> <ide> def self.make_tree(associations) <ide> def join_constraints(outer_joins) <ide> walk join_root, oj.join_root <ide> else <ide> oj.join_root.children.flat_map { |child| <del> make_outer_joins(join_root, child) <add> make_outer_joins join_root, child <ide> } <ide> end <ide> } <ide> end <ide> <del> class Aliases <del> def initialize(tables) <del> @tables = tables <del> @alias_cache = tables.each_with_object({}) { |table,h| <del> h[table.node] = table.columns.each_with_object({}) { |column,i| <del> i[column.name] = column.alias <del> } <del> } <del> @name_and_alias_cache = tables.each_with_object({}) { |table,h| <del> h[table.node] = table.columns.map { |column| <del> [column.name, column.alias] <del> } <del> } <del> end <del> <del> def columns <del> @tables.flat_map { |t| t.column_aliases } <del> end <del> <del> # An array of [column_name, alias] pairs for the table <del> def column_aliases(node) <del> @name_and_alias_cache[node] <del> end <del> <del> def column_alias(node, column) <del> @alias_cache[node][column] <del> end <del> <del> class Table < Struct.new(:node, :columns) <del> def table <del> Arel::Nodes::TableAlias.new node.table, node.aliased_table_name <del> end <del> <del> def column_aliases <del> t = table <del> columns.map { |column| t[column.name].as Arel.sql column.alias } <del> end <del> end <del> Column = Struct.new(:name, :alias) <del> end <del> <ide> def aliases <ide> Aliases.new join_root.each_with_index.map { |join_part,i| <ide> columns = join_part.column_names.each_with_index.map { |column_name,j|
1
Python
Python
improve performance for cifar resnet benchmarks
2ed43e66c4507798c5a3be0f4cc98c57ebb112a2
<ide><path>official/resnet/keras/keras_cifar_main.py <ide> def run(flags_obj): <ide> <ide> strategy = distribution_utils.get_distribution_strategy( <ide> distribution_strategy=flags_obj.distribution_strategy, <del> num_gpus=flags_obj.num_gpus) <add> num_gpus=flags_obj.num_gpus, <add> num_workers=distribution_utils.configure_cluster(), <add> all_reduce_alg=flags_obj.all_reduce_alg, <add> num_packs=flags_obj.num_packs) <ide> <ide> strategy_scope = distribution_utils.get_strategy_scope(strategy) <ide> <ide> def run(flags_obj): <ide> data_dir=flags_obj.data_dir, <ide> batch_size=flags_obj.batch_size, <ide> num_epochs=flags_obj.train_epochs, <del> parse_record_fn=parse_record_keras) <add> parse_record_fn=parse_record_keras, <add> datasets_num_private_threads=flags_obj.datasets_num_private_threads, <add> dtype=dtype) <ide> <del> eval_input_dataset = input_fn( <del> is_training=False, <del> data_dir=flags_obj.data_dir, <del> batch_size=flags_obj.batch_size, <del> num_epochs=flags_obj.train_epochs, <del> parse_record_fn=parse_record_keras) <add> eval_input_dataset = None <add> if not flags_obj.skip_eval: <add> eval_input_dataset = input_fn( <add> is_training=False, <add> data_dir=flags_obj.data_dir, <add> batch_size=flags_obj.batch_size, <add> num_epochs=flags_obj.train_epochs, <add> parse_record_fn=parse_record_keras) <ide> <ide> with strategy_scope: <ide> optimizer = keras_common.get_optimizer() <ide> model = resnet_cifar_model.resnet56(classes=cifar_main.NUM_CLASSES) <ide> <ide> model.compile(loss='categorical_crossentropy', <ide> optimizer=optimizer, <del> run_eagerly=flags_obj.run_eagerly, <del> metrics=['categorical_accuracy']) <add> metrics=(['categorical_accuracy'] <add> if flags_obj.report_accuracy_metrics else None), <add> run_eagerly=flags_obj.run_eagerly) <ide> <ide> callbacks = keras_common.get_callbacks( <ide> learning_rate_schedule, cifar_main.NUM_IMAGES['train']) <ide><path>official/resnet/keras/resnet_cifar_model.py <ide> import tensorflow as tf <ide> from tensorflow.python.keras import backend <ide> from tensorflow.python.keras import layers <add>from tensorflow.python.keras import regularizers <ide> <ide> <ide> BATCH_NORM_DECAY = 0.997 <ide> def identity_building_block(input_tensor, <ide> Output tensor for the block. <ide> """ <ide> filters1, filters2 = filters <del> if tf.keras.backend.image_data_format() == 'channels_last': <add> if backend.image_data_format() == 'channels_last': <ide> bn_axis = 3 <ide> else: <ide> bn_axis = 1 <ide> conv_name_base = 'res' + str(stage) + block + '_branch' <ide> bn_name_base = 'bn' + str(stage) + block + '_branch' <ide> <del> x = tf.keras.layers.Conv2D(filters1, kernel_size, <del> padding='same', <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name=conv_name_base + '2a')(input_tensor) <del> x = tf.keras.layers.BatchNormalization(axis=bn_axis, <del> name=bn_name_base + '2a', <del> momentum=BATCH_NORM_DECAY, <del> epsilon=BATCH_NORM_EPSILON)( <del> x, training=training) <del> x = tf.keras.layers.Activation('relu')(x) <del> <del> x = tf.keras.layers.Conv2D(filters2, kernel_size, <del> padding='same', <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name=conv_name_base + '2b')(x) <del> x = tf.keras.layers.BatchNormalization(axis=bn_axis, <del> name=bn_name_base + '2b', <del> momentum=BATCH_NORM_DECAY, <del> epsilon=BATCH_NORM_EPSILON)( <del> x, training=training) <del> <del> x = tf.keras.layers.add([x, input_tensor]) <del> x = tf.keras.layers.Activation('relu')(x) <add> x = layers.Conv2D(filters1, kernel_size, <add> padding='same', use_bias=False, <add> kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name=conv_name_base + '2a')(input_tensor) <add> x = layers.BatchNormalization( <add> axis=bn_axis, momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON, <add> name=bn_name_base + '2a')(x, training=training) <add> x = layers.Activation('relu')(x) <add> <add> x = layers.Conv2D(filters2, kernel_size, <add> padding='same', use_bias=False, <add> kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name=conv_name_base + '2b')(x) <add> x = layers.BatchNormalization( <add> axis=bn_axis, momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON, <add> name=bn_name_base + '2b')(x, training=training) <add> <add> x = layers.add([x, input_tensor]) <add> x = layers.Activation('relu')(x) <ide> return x <ide> <ide> <ide> def conv_building_block(input_tensor, <ide> conv_name_base = 'res' + str(stage) + block + '_branch' <ide> bn_name_base = 'bn' + str(stage) + block + '_branch' <ide> <del> x = tf.keras.layers.Conv2D(filters1, kernel_size, strides=strides, <del> padding='same', <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name=conv_name_base + '2a')(input_tensor) <del> x = tf.keras.layers.BatchNormalization(axis=bn_axis, <del> name=bn_name_base + '2a', <del> momentum=BATCH_NORM_DECAY, <del> epsilon=BATCH_NORM_EPSILON)( <del> x, training=training) <del> x = tf.keras.layers.Activation('relu')(x) <del> <del> x = tf.keras.layers.Conv2D(filters2, kernel_size, padding='same', <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name=conv_name_base + '2b')(x) <del> x = tf.keras.layers.BatchNormalization(axis=bn_axis, <del> name=bn_name_base + '2b', <del> momentum=BATCH_NORM_DECAY, <del> epsilon=BATCH_NORM_EPSILON)( <del> x, training=training) <del> <del> shortcut = tf.keras.layers.Conv2D(filters2, (1, 1), strides=strides, <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name=conv_name_base + '1')(input_tensor) <del> shortcut = tf.keras.layers.BatchNormalization( <del> axis=bn_axis, name=bn_name_base + '1', <del> momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON)( <del> shortcut, training=training) <del> <del> x = tf.keras.layers.add([x, shortcut]) <del> x = tf.keras.layers.Activation('relu')(x) <add> x = layers.Conv2D(filters1, kernel_size, strides=strides, <add> padding='same', use_bias=False, <add> kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name=conv_name_base + '2a')(input_tensor) <add> x = layers.BatchNormalization( <add> axis=bn_axis, momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON, <add> name=bn_name_base + '2a')(x, training=training) <add> x = layers.Activation('relu')(x) <add> <add> x = layers.Conv2D(filters2, kernel_size, padding='same', use_bias=False, <add> kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name=conv_name_base + '2b')(x) <add> x = layers.BatchNormalization( <add> axis=bn_axis, momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON, <add> name=bn_name_base + '2b')(x, training=training) <add> <add> shortcut = layers.Conv2D(filters2, (1, 1), strides=strides, use_bias=False, <add> kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name=conv_name_base + '1')(input_tensor) <add> shortcut = layers.BatchNormalization( <add> axis=bn_axis, momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON, <add> name=bn_name_base + '1')(shortcut, training=training) <add> <add> x = layers.add([x, shortcut]) <add> x = layers.Activation('relu')(x) <ide> return x <ide> <ide> <ide> def resnet_block(input_tensor, <ide> block='block_%d' % (i + 1), training=training) <ide> return x <ide> <add> <ide> def resnet(num_blocks, classes=10, training=None): <ide> """Instantiates the ResNet architecture. <ide> <ide> def resnet(num_blocks, classes=10, training=None): <ide> x = img_input <ide> bn_axis = 3 <ide> <del> x = tf.keras.layers.ZeroPadding2D(padding=(1, 1), name='conv1_pad')(x) <del> x = tf.keras.layers.Conv2D(16, (3, 3), <del> strides=(1, 1), <del> padding='valid', <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name='conv1')(x) <del> x = tf.keras.layers.BatchNormalization(axis=bn_axis, name='bn_conv1', <del> momentum=BATCH_NORM_DECAY, <del> epsilon=BATCH_NORM_EPSILON)( <del> x, training=training) <del> x = tf.keras.layers.Activation('relu')(x) <add> x = layers.ZeroPadding2D(padding=(1, 1), name='conv1_pad')(x) <add> x = layers.Conv2D(16, (3, 3), <add> strides=(1, 1), <add> padding='valid', use_bias=False, <add> kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name='conv1')(x) <add> x = layers.BatchNormalization(axis=bn_axis, <add> momentum=BATCH_NORM_DECAY, <add> epsilon=BATCH_NORM_EPSILON, <add> name='bn_conv1',)(x, training=training) <add> x = layers.Activation('relu')(x) <ide> <ide> x = resnet_block(x, size=num_blocks, kernel_size=3, filters=[16, 16], <ide> stage=2, conv_strides=(1, 1), training=training) <ide> def resnet(num_blocks, classes=10, training=None): <ide> x = resnet_block(x, size=num_blocks, kernel_size=3, filters=[64, 64], <ide> stage=4, conv_strides=(2, 2), training=training) <ide> <del> x = tf.keras.layers.GlobalAveragePooling2D(name='avg_pool')(x) <del> x = tf.keras.layers.Dense(classes, activation='softmax', <del> kernel_initializer='he_normal', <del> kernel_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> bias_regularizer= <del> tf.keras.regularizers.l2(L2_WEIGHT_DECAY), <del> name='fc10')(x) <add> rm_axes = [1, 2] if backend.image_data_format() == 'channels_last' else [2, 3] <add> x = layers.Lambda(lambda x: backend.mean(x, rm_axes), name='reduce_mean')(x) <add> x = layers.Dense(classes, activation='softmax', <add> # kernel_initializer='he_normal', <add> kernel_regularizer=regularizers.l2(L2_WEIGHT_DECAY), <add> name='fc10')(x) <ide> <ide> inputs = img_input <ide> # Create model.
2
Text
Text
change sentences for better comprehension
ea571ee044841514d155dac0d86296f83e0eef45
<ide><path>guide/english/sql/sql-where-clause/index.md <ide> title: SQL Where Clause <ide> <ide> ### `WHERE` Clause (and/or, `IN`, `BETWEEN`, and `LIKE`) <ide> <del>The `WHERE` clause is used to limit the number of rows returned. <add>The `WHERE` clause is used to filter the number of rows returned. <ide> <ide> In this case all five of these will be used is a some what ridiculous `WHERE` clause. <ide> <ide> select studentID, FullName, sat_score, rcd_updated from student; <ide> 9 rows in set (0.00 sec) <ide> ``` <ide> <del>Rows will be presented that.... <add>We 'd like to apply the following filters: <ide> <ide> * `WHERE` Student IDs are between 1 and 5 (inclusive) <ide> * `OR` studentID = 8
1
Javascript
Javascript
replace \u2019 with regular ascii quote
fd8587eb38804311c53d1da8315f267614d77c58
<ide><path>lib/buffer.js <ide> function fromString(string, encoding) { <ide> var b = new FastBuffer(allocPool, poolOffset, length); <ide> var actual = b.write(string, encoding); <ide> if (actual !== length) { <del> // byteLength() may overestimate. That’s a rare case, though. <add> // byteLength() may overestimate. That's a rare case, though. <ide> b = new FastBuffer(allocPool, poolOffset, actual); <ide> } <ide> poolOffset += actual; <ide><path>lib/repl.js <ide> function REPLServer(prompt, <ide> let previouslyInRawMode; <ide> if (self.breakEvalOnSigint) { <ide> // Start the SIGINT watchdog before entering raw mode so that a very <del> // quick Ctrl+C doesn’t lead to aborting the process completely. <add> // quick Ctrl+C doesn't lead to aborting the process completely. <ide> utilBinding.startSigintWatchdog(); <ide> previouslyInRawMode = self._setRawMode(false); <ide> }
2
Text
Text
add @ramiro for thanks!
b8561f41238e0ad79b2cc823518a93314d987979
<ide><path>docs/topics/credits.md <ide> The following people have helped make REST framework great. <ide> * Jeremy Satterfield - [jsatt] <ide> * Christopher Paolini - [chrispaolini] <ide> * Filipe A Ximenes - [filipeximenes] <add>* Ramiro Morales - [ramiro] <ide> <ide> Many thanks to everyone who's contributed to the project. <ide> <ide> You can also contact [@_tomchristie][twitter] directly on twitter. <ide> [jsatt]: https://github.com/jsatt <ide> [chrispaolini]: https://github.com/chrispaolini <ide> [filipeximenes]: https://github.com/filipeximenes <add>[ramiro]: https://github.com/ramiro
1
Javascript
Javascript
remove default parameters from lint rule
c8e137b1b53ef6059bcee48376d1617fb734fdfc
<ide><path>tools/eslint-rules/align-multiline-assignment.js <ide> //------------------------------------------------------------------------------ <ide> // Rule Definition <ide> //------------------------------------------------------------------------------ <del>function getBinaryExpressionStarts(binaryExpression, starts = []) { <add>function getBinaryExpressionStarts(binaryExpression, starts) { <ide> function getStartsFromOneSide(side, starts) { <ide> starts.push(side.loc.start); <ide> if (side.type === 'BinaryExpression') { <ide> function checkExpressionAlignment(expression) { <ide> <ide> switch (expression.type) { <ide> case 'BinaryExpression': <del> var starts = getBinaryExpressionStarts(expression); <add> var starts = getBinaryExpressionStarts(expression, []); <ide> var startLine = starts[0].line; <ide> const startColumn = starts[0].column; <ide> starts.forEach((loc) => {
1
Python
Python
fix package command and add version option
fe06697150ba7ce0cf28dfe37cdf9d84b58fa234
<ide><path>spacy/cli/package.py <ide> def package_cli( <ide> # fmt: off <ide> input_dir: Path = Arg(..., help="Directory with model data", exists=True, file_okay=False), <ide> output_dir: Path = Arg(..., help="Output parent directory", exists=True, file_okay=False), <del> meta_path: Optional[Path] = Opt(None, "--meta-path", "-m", help="Path to meta.json", exists=True, dir_okay=False), <add> meta_path: Optional[Path] = Opt(None, "--meta-path", "--meta", "-m", help="Path to meta.json", exists=True, dir_okay=False), <ide> create_meta: bool = Opt(False, "--create-meta", "-c", "-C", help="Create meta.json, even if one exists"), <add> version: Optional[str] = Opt(None, "--version", "-v", help="Package version to override meta"), <ide> force: bool = Opt(False, "--force", "-f", "-F", help="Force overwriting existing model in output directory"), <ide> # fmt: on <ide> ): <ide> def package_cli( <ide> input_dir, <ide> output_dir, <ide> meta_path=meta_path, <add> version=version, <ide> create_meta=create_meta, <ide> force=force, <ide> silent=False, <ide> def package( <ide> input_dir: Path, <ide> output_dir: Path, <ide> meta_path: Optional[Path] = None, <add> version: Optional[str] = None, <ide> create_meta: bool = False, <ide> force: bool = False, <ide> silent: bool = True, <ide> def package( <ide> if not meta_path.exists() or not meta_path.is_file(): <ide> msg.fail("Can't load model meta.json", meta_path, exits=1) <ide> meta = srsly.read_json(meta_path) <add> meta = get_meta(input_dir, meta) <add> if version is not None: <add> meta["version"] = version <ide> if not create_meta: # only print if user doesn't want to overwrite <ide> msg.good("Loaded meta.json from file", meta_path) <ide> else: <del> meta = generate_meta(input_dir, meta, msg) <add> meta = generate_meta(meta, msg) <ide> errors = validate(ModelMetaSchema, meta) <ide> if errors: <ide> msg.fail("Invalid model meta.json", "\n".join(errors), exits=1) <ide> def create_file(file_path: Path, contents: str) -> None: <ide> file_path.open("w", encoding="utf-8").write(contents) <ide> <ide> <del>def generate_meta( <del> model_path: Union[str, Path], existing_meta: Dict[str, Any], msg: Printer <add>def get_meta( <add> model_path: Union[str, Path], existing_meta: Dict[str, Any] <ide> ) -> Dict[str, Any]: <del> meta = existing_meta or {} <del> settings = [ <del> ("lang", "Model language", meta.get("lang", "en")), <del> ("name", "Model name", meta.get("name", "model")), <del> ("version", "Model version", meta.get("version", "0.0.0")), <del> ("description", "Model description", meta.get("description", False)), <del> ("author", "Author", meta.get("author", False)), <del> ("email", "Author email", meta.get("email", False)), <del> ("url", "Author website", meta.get("url", False)), <del> ("license", "License", meta.get("license", "MIT")), <del> ] <add> meta = { <add> "lang": "en", <add> "name": "model", <add> "version": "0.0.0", <add> "description": None, <add> "author": None, <add> "email": None, <add> "url": None, <add> "license": "MIT", <add> } <add> meta.update(existing_meta) <ide> nlp = util.load_model_from_path(Path(model_path)) <ide> meta["spacy_version"] = util.get_model_version_range(about.__version__) <ide> meta["pipeline"] = nlp.pipe_names <ide> def generate_meta( <ide> "keys": nlp.vocab.vectors.n_keys, <ide> "name": nlp.vocab.vectors.name, <ide> } <add> if about.__title__ != "spacy": <add> meta["parent_package"] = about.__title__ <add> return meta <add> <add> <add>def generate_meta(existing_meta: Dict[str, Any], msg: Printer) -> Dict[str, Any]: <add> meta = existing_meta or {} <add> settings = [ <add> ("lang", "Model language", meta.get("lang", "en")), <add> ("name", "Model name", meta.get("name", "model")), <add> ("version", "Model version", meta.get("version", "0.0.0")), <add> ("description", "Model description", meta.get("description", None)), <add> ("author", "Author", meta.get("author", None)), <add> ("email", "Author email", meta.get("email", None)), <add> ("url", "Author website", meta.get("url", None)), <add> ("license", "License", meta.get("license", "MIT")), <add> ] <ide> msg.divider("Generating meta.json") <ide> msg.text( <ide> "Enter the package settings for your model. The following information " <ide> def generate_meta( <ide> for setting, desc, default in settings: <ide> response = get_raw_input(desc, default) <ide> meta[setting] = default if response == "" and default else response <del> if about.__title__ != "spacy": <del> meta["parent_package"] = about.__title__ <ide> return meta <ide> <ide> <ide> def setup_package(): <ide> <ide> setup( <ide> name=model_name, <del> description=meta['description'], <del> author=meta['author'], <del> author_email=meta['email'], <del> url=meta['url'], <add> description=meta.get('description'), <add> author=meta.get('author'), <add> author_email=meta.get('email'), <add> url=meta.get('url'), <ide> version=meta['version'], <del> license=meta['license'], <add> license=meta.get('license'), <ide> packages=[model_name], <ide> package_data={model_name: list_files(model_dir)}, <ide> install_requires=list_requirements(meta),
1
Ruby
Ruby
use uri and inflector
3962be5b8c20da54421ae472f06c741f0472fd46
<ide><path>activeresource/lib/active_resource/base.rb <ide> require 'active_support' <ide> require 'active_support/core_ext/class/attribute_accessors' <ide> require 'active_support/core_ext/class/inheritable_attributes' <add>require 'active_support/core_ext/kernel/reporting' <ide> require 'active_support/core_ext/module/attr_accessor_with_default' <ide> require 'active_support/core_ext/module/delegation' <ide> require 'active_support/core_ext/module/aliasing' <ide> require 'active_support/core_ext/object/blank' <ide> require 'active_support/core_ext/object/misc' <ide> require 'set' <add>require 'uri' <ide> <ide> module ActiveResource <ide> autoload :Formats, 'active_resource/formats' <ide> def headers <ide> <ide> # Do not include any modules in the default element name. This makes it easier to seclude ARes objects <ide> # in a separate namespace without having to set element_name repeatedly. <del> attr_accessor_with_default(:element_name) { to_s.split("::").last.underscore } #:nodoc: <add> attr_accessor_with_default(:element_name) { ActiveSupport::Inflector.underscore(to_s.split("::").last) } #:nodoc: <ide> <del> attr_accessor_with_default(:collection_name) { element_name.pluralize } #:nodoc: <add> attr_accessor_with_default(:collection_name) { ActiveSupport::Inflector.pluralize(element_name) } #:nodoc: <ide> attr_accessor_with_default(:primary_key, 'id') #:nodoc: <ide> <ide> # Gets the \prefix for a resource's nested URL (e.g., <tt>prefix/collectionname/1.xml</tt>)
1
Ruby
Ruby
remove the old command files
03c982fa3417fc49a380eeb88fdd26fdd4bae46b
<ide><path>railties/lib/rails/commands/application.rb <del>require "rails/generators" <del>require "rails/generators/rails/app/app_generator" <del> <del>module Rails <del> module Generators <del> class AppGenerator # :nodoc: <del> # We want to exit on failure to be kind to other libraries <del> # This is only when accessing via CLI <del> def self.exit_on_failure? <del> true <del> end <del> end <del> end <del>end <del> <del>args = Rails::Generators::ARGVScrubber.new(ARGV).prepare! <del>Rails::Generators::AppGenerator.start args <ide><path>railties/lib/rails/commands/commands_tasks.rb <del>require "rails/commands/rake_proxy" <del>require "rails/commands/common_commands_tasks" <del>require "active_support/core_ext/string/strip" <del> <del>module Rails <del> # This is a class which takes in a rails command and initiates the appropriate <del> # initiation sequence. <del> # <del> # Warning: This class mutates ARGV because some commands require manipulating <del> # it before they are run. <del> class CommandsTasks # :nodoc: <del> include Rails::RakeProxy <del> include Rails::CommonCommandsTasks <del> <del> attr_reader :argv <del> <del> ADDITIONAL_COMMANDS = [ <del> [ "destroy", 'Undo code generated with "generate" (short-cut alias: "d")' ], <del> [ "plugin new", "Generates skeleton for developing a Rails plugin" ], <del> [ "runner", <del> 'Run a piece of code in the application environment (short-cut alias: "r")' ] <del> ] <del> <del> def initialize(argv) <del> @argv = argv <del> end <del> <del> def plugin <del> require_command!("plugin") <del> end <del> <del> def console <del> require_command!("console") <del> options = Rails::Console.parse_arguments(argv) <del> <del> # RAILS_ENV needs to be set before config/application is required <del> ENV["RAILS_ENV"] = options[:environment] if options[:environment] <del> <del> # shift ARGV so IRB doesn't freak <del> shift_argv! <del> <del> require_application_and_environment! <del> Rails::Console.start(Rails.application, options) <del> end <del> <del> def server <del> set_application_directory! <del> require_command!("server") <del> <del> Rails::Server.new.tap do |server| <del> # We need to require application after the server sets environment, <del> # otherwise the --environment option given to the server won't propagate. <del> require APP_PATH <del> Dir.chdir(Rails.application.root) <del> server.start <del> end <del> end <del> <del> def dbconsole <del> require_command!("dbconsole") <del> Rails::DBConsole.start <del> end <del> <del> def runner <del> require_command!("runner") <del> end <del> <del> def new <del> if %w(-h --help).include?(argv.first) <del> require_command!("application") <del> else <del> exit_with_initialization_warning! <del> end <del> end <del> <del> private <del> <del> def exit_with_initialization_warning! <del> puts "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.\n" <del> puts "Type 'rails' for help." <del> exit(1) <del> end <del> <del> def shift_argv! <del> argv.shift if argv.first && argv.first[0] != "-" <del> end <del> <del> # Change to the application's path if there is no config.ru file in current directory. <del> # This allows us to run `rails server` from other directories, but still get <del> # the main config.ru and properly set the tmp directory. <del> def set_application_directory! <del> Dir.chdir(File.expand_path("../../", APP_PATH)) unless File.exist?(File.expand_path("config.ru")) <del> end <del> <del> def commands <del> ADDITIONAL_COMMANDS + formatted_rake_tasks <del> end <del> <del> def command_whitelist <del> %w(plugin generate destroy console server dbconsole runner new version help test) <del> end <del> <del> def help_message <del> <<-EOT.strip_heredoc <del> Usage: rails COMMAND [ARGS] <del> <del> The most common rails commands are: <del> generate Generate new code (short-cut alias: "g") <del> console Start the Rails console (short-cut alias: "c") <del> server Start the Rails server (short-cut alias: "s") <del> test Run tests (short-cut alias: "t") <del> dbconsole Start a console for the database specified in config/database.yml <del> (short-cut alias: "db") <del> new Create a new Rails application. "rails new my_app" creates a <del> new application called MyApp in "./my_app" <del> <del> All commands can be run with -h (or --help) for more information. <del> <del> In addition to those commands, there are: <del> EOT <del> end <del> <del> def require_application_and_environment! <del> require APP_PATH <del> Rails.application.require_environment! <del> end <del> <del> def load_tasks <del> Rails.application.load_tasks <del> end <del> <del> def load_generators <del> Rails.application.load_generators <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/common_commands_tasks.rb <del>module Rails <del> module CommonCommandsTasks # :nodoc: <del> def run_command!(command) <del> command = parse_command(command) <del> <del> if command_whitelist.include?(command) <del> send(command) <del> else <del> run_rake_task(command) <del> end <del> end <del> <del> def generate <del> generate_or_destroy(:generate) <del> end <del> <del> def destroy <del> generate_or_destroy(:destroy) <del> end <del> <del> def test <del> require_command!("test") <del> end <del> <del> def version <del> argv.unshift "--version" <del> require_command!("application") <del> end <del> <del> def help <del> write_help_message <del> write_commands(commands) <del> end <del> <del> private <del> <del> def generate_or_destroy(command) <del> require "rails/generators" <del> require_application_and_environment! <del> load_generators <del> require_command!(command) <del> end <del> <del> def require_command!(command) <del> require "rails/commands/#{command}" <del> end <del> <del> def write_help_message <del> puts help_message <del> end <del> <del> def write_commands(commands) <del> width = commands.map { |name, _| name.size }.max || 10 <del> commands.each { |command| printf(" %-#{width}s %s\n", *command) } <del> end <del> <del> def parse_command(command) <del> case command <del> when "--version", "-v" <del> "version" <del> when "--help", "-h" <del> "help" <del> else <del> command <del> end <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/console.rb <del>require "optparse" <del>require "irb" <del>require "irb/completion" <del>require "rails/commands/console_helper" <del> <del>module Rails <del> class Console <del> include ConsoleHelper <del> <del> module BacktraceCleaner <del> def filter_backtrace(bt) <del> if result = super <del> Rails.backtrace_cleaner.filter([result]).first <del> end <del> end <del> end <del> <del> class << self <del> def parse_arguments(arguments) <del> options = {} <del> <del> OptionParser.new do |opt| <del> opt.banner = "Usage: rails console [environment] [options]" <del> opt.on("-s", "--sandbox", "Rollback database modifications on exit.") { |v| options[:sandbox] = v } <del> opt.on("-e", "--environment=name", String, <del> "Specifies the environment to run this console under (test/development/production).", <del> "Default: development") { |v| options[:environment] = v.strip } <del> opt.parse!(arguments) <del> end <del> <del> set_options_env(arguments, options) <del> end <del> end <del> <del> attr_reader :options, :app, :console <del> <del> def initialize(app, options={}) <del> @app = app <del> @options = options <del> <del> app.sandbox = sandbox? <del> app.load_console <del> <del> @console = app.config.console || IRB <del> <del> if @console == IRB <del> IRB::WorkSpace.prepend(BacktraceCleaner) <del> end <del> end <del> <del> def sandbox? <del> options[:sandbox] <del> end <del> <del> def environment <del> options[:environment] ||= super <del> end <del> alias_method :environment?, :environment <del> <del> def set_environment! <del> Rails.env = environment <del> end <del> <del> def start <del> set_environment! if environment? <del> <del> if sandbox? <del> puts "Loading #{Rails.env} environment in sandbox (Rails #{Rails.version})" <del> puts "Any modifications you make will be rolled back on exit" <del> else <del> puts "Loading #{Rails.env} environment (Rails #{Rails.version})" <del> end <del> <del> if defined?(console::ExtendCommandBundle) <del> console::ExtendCommandBundle.include(Rails::ConsoleMethods) <del> end <del> console.start <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/console_helper.rb <del>require "active_support/concern" <del> <del>module Rails <del> module ConsoleHelper # :nodoc: <del> extend ActiveSupport::Concern <del> <del> module ClassMethods <del> def start(*args) <del> new(*args).start <del> end <del> <del> private <del> def set_options_env(arguments, options) <del> if arguments.first && arguments.first[0] != "-" <del> env = arguments.first <del> if available_environments.include? env <del> options[:environment] = env <del> else <del> options[:environment] = %w(production development test).detect { |e| e =~ /^#{env}/ } || env <del> end <del> end <del> options <del> end <del> <del> def available_environments <del> Dir["config/environments/*.rb"].map { |fname| File.basename(fname, ".*") } <del> end <del> end <del> <del> def environment <del> ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/dbconsole.rb <del>require "erb" <del>require "yaml" <del>require "optparse" <del>require "rails/commands/console_helper" <del> <del>module Rails <del> class DBConsole <del> include ConsoleHelper <del> <del> attr_reader :arguments <del> <del> class << self <del> def parse_arguments(arguments) <del> options = {} <del> <del> OptionParser.new do |opt| <del> opt.banner = "Usage: rails dbconsole [environment] [options]" <del> opt.on("-p", "--include-password", "Automatically provide the password from database.yml") do |v| <del> options["include_password"] = true <del> end <del> <del> opt.on("--mode [MODE]", ["html", "list", "line", "column"], <del> "Automatically put the sqlite3 database in the specified mode (html, list, line, column).") do |mode| <del> options["mode"] = mode <del> end <del> <del> opt.on("--header") do |h| <del> options["header"] = h <del> end <del> <del> opt.on("-h", "--help", "Show this help message.") do <del> puts opt <del> exit <del> end <del> <del> opt.on("-e", "--environment=name", String, <del> "Specifies the environment to run this console under (test/development/production).", <del> "Default: development" <del> ) { |v| options[:environment] = v.strip } <del> <del> opt.parse!(arguments) <del> abort opt.to_s unless (0..1).include?(arguments.size) <del> end <del> <del> set_options_env(arguments, options) <del> end <del> end <del> <del> def initialize(arguments = ARGV) <del> @arguments = arguments <del> end <del> <del> def start <del> options = self.class.parse_arguments(arguments) <del> ENV["RAILS_ENV"] = options[:environment] || environment <del> <del> case config["adapter"] <del> when /^(jdbc)?mysql/ <del> args = { <del> "host" => "--host", <del> "port" => "--port", <del> "socket" => "--socket", <del> "username" => "--user", <del> "encoding" => "--default-character-set", <del> "sslca" => "--ssl-ca", <del> "sslcert" => "--ssl-cert", <del> "sslcapath" => "--ssl-capath", <del> "sslcipher" => "--ssl-cipher", <del> "sslkey" => "--ssl-key" <del> }.map { |opt, arg| "#{arg}=#{config[opt]}" if config[opt] }.compact <del> <del> if config["password"] && options["include_password"] <del> args << "--password=#{config['password']}" <del> elsif config["password"] && !config["password"].to_s.empty? <del> args << "-p" <del> end <del> <del> args << config["database"] <del> <del> find_cmd_and_exec(["mysql", "mysql5"], *args) <del> <del> when /^postgres|^postgis/ <del> ENV["PGUSER"] = config["username"] if config["username"] <del> ENV["PGHOST"] = config["host"] if config["host"] <del> ENV["PGPORT"] = config["port"].to_s if config["port"] <del> ENV["PGPASSWORD"] = config["password"].to_s if config["password"] && options["include_password"] <del> find_cmd_and_exec("psql", config["database"]) <del> <del> when "sqlite3" <del> args = [] <del> <del> args << "-#{options['mode']}" if options["mode"] <del> args << "-header" if options["header"] <del> args << File.expand_path(config["database"], Rails.respond_to?(:root) ? Rails.root : nil) <del> <del> find_cmd_and_exec("sqlite3", *args) <del> <del> when "oracle", "oracle_enhanced" <del> logon = "" <del> <del> if config["username"] <del> logon = config["username"] <del> logon << "/#{config['password']}" if config["password"] && options["include_password"] <del> logon << "@#{config['database']}" if config["database"] <del> end <del> <del> find_cmd_and_exec("sqlplus", logon) <del> <del> when "sqlserver" <del> args = [] <del> <del> args += ["-D", "#{config['database']}"] if config["database"] <del> args += ["-U", "#{config['username']}"] if config["username"] <del> args += ["-P", "#{config['password']}"] if config["password"] <del> <del> if config["host"] <del> host_arg = "#{config['host']}" <del> host_arg << ":#{config['port']}" if config["port"] <del> args += ["-S", host_arg] <del> end <del> <del> find_cmd_and_exec("sqsh", *args) <del> <del> else <del> abort "Unknown command-line client for #{config['database']}." <del> end <del> end <del> <del> def config <del> @config ||= begin <del> if configurations[environment].blank? <del> raise ActiveRecord::AdapterNotSpecified, "'#{environment}' database is not configured. Available configuration: #{configurations.inspect}" <del> else <del> configurations[environment] <del> end <del> end <del> end <del> <del> def environment <del> Rails.respond_to?(:env) ? Rails.env : super <del> end <del> <del> protected <del> def configurations <del> require APP_PATH <del> ActiveRecord::Base.configurations = Rails.application.config.database_configuration <del> ActiveRecord::Base.configurations <del> end <del> <del> def find_cmd_and_exec(commands, *args) <del> commands = Array(commands) <del> <del> dirs_on_path = ENV["PATH"].to_s.split(File::PATH_SEPARATOR) <del> unless (ext = RbConfig::CONFIG["EXEEXT"]).empty? <del> commands = commands.map { |cmd| "#{cmd}#{ext}" } <del> end <del> <del> full_path_command = nil <del> found = commands.detect do |cmd| <del> dirs_on_path.detect do |path| <del> full_path_command = File.join(path, cmd) <del> File.file?(full_path_command) && File.executable?(full_path_command) <del> end <del> end <del> <del> if found <del> exec full_path_command, *args <del> else <del> abort("Couldn't find database client: #{commands.join(', ')}. Check your $PATH and try again.") <del> end <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/destroy.rb <del>require "rails/generators" <del> <del>#if no argument/-h/--help is passed to rails destroy command, then <del>#it generates the help associated. <del>if [nil, "-h", "--help"].include?(ARGV.first) <del> Rails::Generators.help "destroy" <del> exit <del>end <del> <del>name = ARGV.shift <del>Rails::Generators.invoke name, ARGV, behavior: :revoke, destination_root: Rails.root <ide><path>railties/lib/rails/commands/generate.rb <del>require "rails/generators" <del> <del>#if no argument/-h/--help is passed to rails generate command, then <del>#it generates the help associated. <del>if [nil, "-h", "--help"].include?(ARGV.first) <del> Rails::Generators.help "generate" <del> exit <del>end <del> <del>name = ARGV.shift <del> <del>root = defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root <del>Rails::Generators.invoke name, ARGV, behavior: :invoke, destination_root: root <ide><path>railties/lib/rails/commands/plugin.rb <del>if ARGV.first != "new" <del> ARGV[0] = "--help" <del>else <del> ARGV.shift <del> unless ARGV.delete("--no-rc") <del> customrc = ARGV.index { |x| x.include?("--rc=") } <del> railsrc = if customrc <del> File.expand_path(ARGV.delete_at(customrc).gsub(/--rc=/, "")) <del> else <del> File.join(File.expand_path("~"), ".railsrc") <del> end <del> <del> if File.exist?(railsrc) <del> extra_args_string = File.read(railsrc) <del> extra_args = extra_args_string.split(/\n+/).flat_map(&:split) <del> puts "Using #{extra_args.join(" ")} from #{railsrc}" <del> ARGV.insert(1, *extra_args) <del> end <del> end <del>end <del> <del>require "rails/generators" <del>require "rails/generators/rails/plugin/plugin_generator" <del>Rails::Generators::PluginGenerator.start <ide><path>railties/lib/rails/commands/rake_proxy.rb <del>require "active_support" <del> <del>module Rails <del> module RakeProxy #:nodoc: <del> private <del> def run_rake_task(command) <del> require_rake <del> <del> ARGV.unshift(command) # Prepend the command, so Rake knows how to run it. <del> <del> Rake.application.standard_exception_handling do <del> Rake.application.init("rails") <del> Rake.application.load_rakefile <del> Rake.application.top_level <del> end <del> end <del> <del> def rake_tasks <del> require_rake <del> <del> return @rake_tasks if defined?(@rake_tasks) <del> <del> ActiveSupport::Deprecation.silence do <del> require_application_and_environment! <del> end <del> <del> Rake::TaskManager.record_task_metadata = true <del> Rake.application.instance_variable_set(:@name, "rails") <del> load_tasks <del> @rake_tasks = Rake.application.tasks.select(&:comment) <del> end <del> <del> def formatted_rake_tasks <del> rake_tasks.map { |t| [ t.name_with_args, t.comment ] } <del> end <del> <del> def require_rake <del> require "rake" # Defer booting Rake until we know it's needed. <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/runner.rb <del>require "optparse" <del> <del>options = { environment: (ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development").dup } <del>code_or_file = nil <del>command = "bin/rails runner" <del> <del>if ARGV.first.nil? <del> ARGV.push "-h" <del>end <del> <del>ARGV.clone.options do |opts| <del> opts.banner = "Usage: rails runner [options] [<'Some.ruby(code)'> | <filename.rb>]" <del> <del> opts.separator "" <del> <del> opts.on("-e", "--environment=name", String, <del> "Specifies the environment for the runner to operate under (test/development/production).", <del> "Default: development") { |v| options[:environment] = v } <del> <del> opts.separator "" <del> <del> opts.on("-h", "--help", <del> "Show this help message.") { $stdout.puts opts; exit } <del> <del> opts.separator "" <del> opts.separator "Examples: " <del> <del> opts.separator " rails runner 'puts Rails.env'" <del> opts.separator " This runs the code `puts Rails.env` after loading the app" <del> opts.separator "" <del> opts.separator " rails runner path/to/filename.rb" <del> opts.separator " This runs the Ruby file located at `path/to/filename.rb` after loading the app" <del> <del> if RbConfig::CONFIG["host_os"] !~ /mswin|mingw/ <del> opts.separator "" <del> opts.separator "You can also use runner as a shebang line for your executables:" <del> opts.separator " -------------------------------------------------------------" <del> opts.separator " #!/usr/bin/env #{File.expand_path(command)}" <del> opts.separator "" <del> opts.separator " Product.all.each { |p| p.price *= 2 ; p.save! }" <del> opts.separator " -------------------------------------------------------------" <del> end <del> <del> opts.order! { |o| code_or_file ||= o } rescue retry <del>end <del> <del>ARGV.delete(code_or_file) <del> <del>ENV["RAILS_ENV"] = options[:environment] <del> <del>require APP_PATH <del>Rails.application.require_environment! <del>Rails.application.load_runner <del> <del>if code_or_file.nil? <del> $stderr.puts "Run '#{command} -h' for help." <del> exit 1 <del>elsif File.exist?(code_or_file) <del> $0 = code_or_file <del> Kernel.load code_or_file <del>else <del> begin <del> eval(code_or_file, binding, __FILE__, __LINE__) <del> rescue SyntaxError, NameError => e <del> $stderr.puts "Please specify a valid ruby command or the path of a script to run." <del> $stderr.puts "Run '#{command} -h' for help." <del> $stderr.puts <del> $stderr.puts e <del> exit 1 <del> end <del>end <ide><path>railties/lib/rails/commands/server.rb <del>require "fileutils" <del>require "optparse" <del>require "action_dispatch" <del>require "rails" <del>require "rails/dev_caching" <del> <del>module Rails <del> class Server < ::Rack::Server <del> class Options <del> DEFAULT_PID_PATH = File.expand_path("tmp/pids/server.pid").freeze <del> <del> def parse!(args) <del> args, options = args.dup, {} <del> <del> option_parser(options).parse! args <del> <del> options[:log_stdout] = options[:daemonize].blank? && (options[:environment] || Rails.env) == "development" <del> options[:server] = args.shift <del> options <del> end <del> <del> private <del> <del> def option_parser(options) <del> OptionParser.new do |opts| <del> opts.banner = "Usage: rails server [puma, thin etc] [options]" <del> opts.on("-p", "--port=port", Integer, <del> "Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v } <del> opts.on("-b", "--binding=IP", String, <del> "Binds Rails to the specified IP.", "Default: localhost") { |v| options[:Host] = v } <del> opts.on("-c", "--config=file", String, <del> "Uses a custom rackup configuration.") { |v| options[:config] = v } <del> opts.on("-d", "--daemon", "Runs server as a Daemon.") { options[:daemonize] = true } <del> opts.on("-e", "--environment=name", String, <del> "Specifies the environment to run this server under (test/development/production).", <del> "Default: development") { |v| options[:environment] = v } <del> opts.on("-P", "--pid=pid", String, <del> "Specifies the PID file.", <del> "Default: tmp/pids/server.pid") { |v| options[:pid] = v } <del> opts.on("-C", "--[no-]dev-caching", <del> "Specifies whether to perform caching in development.", <del> "true or false") { |v| options[:caching] = v } <del> <del> opts.separator "" <del> <del> opts.on("-h", "--help", "Shows this help message.") { puts opts; exit } <del> end <del> end <del> end <del> <del> def initialize(*) <del> super <del> set_environment <del> end <del> <del> # TODO: this is no longer required but we keep it for the moment to support older config.ru files. <del> def app <del> @app ||= begin <del> app = super <del> app.respond_to?(:to_app) ? app.to_app : app <del> end <del> end <del> <del> def opt_parser <del> Options.new <del> end <del> <del> def set_environment <del> ENV["RAILS_ENV"] ||= options[:environment] <del> end <del> <del> def start <del> print_boot_information <del> trap(:INT) { exit } <del> create_tmp_directories <del> setup_dev_caching <del> log_to_stdout if options[:log_stdout] <del> <del> super <del> ensure <del> # The '-h' option calls exit before @options is set. <del> # If we call 'options' with it unset, we get double help banners. <del> puts "Exiting" unless @options && options[:daemonize] <del> end <del> <del> def middleware <del> Hash.new([]) <del> end <del> <del> def default_options <del> super.merge( <del> Port: ENV.fetch("PORT", 3000).to_i, <del> Host: ENV.fetch("HOST", "localhost").dup, <del> DoNotReverseLookup: true, <del> environment: (ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development").dup, <del> daemonize: false, <del> caching: nil, <del> pid: Options::DEFAULT_PID_PATH, <del> restart_cmd: restart_command) <del> end <del> <del> private <del> <del> def setup_dev_caching <del> if options[:environment] == "development" <del> Rails::DevCaching.enable_by_argument(options[:caching]) <del> end <del> end <del> <del> def print_boot_information <del> url = "#{options[:SSLEnable] ? 'https' : 'http'}://#{options[:Host]}:#{options[:Port]}" <del> puts "=> Booting #{ActiveSupport::Inflector.demodulize(server)}" <del> puts "=> Rails #{Rails.version} application starting in #{Rails.env} on #{url}" <del> puts "=> Run `rails server -h` for more startup options" <del> end <del> <del> def create_tmp_directories <del> %w(cache pids sockets).each do |dir_to_make| <del> FileUtils.mkdir_p(File.join(Rails.root, "tmp", dir_to_make)) <del> end <del> end <del> <del> def log_to_stdout <del> wrapped_app # touch the app so the logger is set up <del> <del> console = ActiveSupport::Logger.new(STDOUT) <del> console.formatter = Rails.logger.formatter <del> console.level = Rails.logger.level <del> <del> unless ActiveSupport::Logger.logger_outputs_to?(Rails.logger, STDOUT) <del> Rails.logger.extend(ActiveSupport::Logger.broadcast(console)) <del> end <del> end <del> <del> def restart_command <del> "bin/rails server #{ARGV.join(' ')}" <del> end <del> end <del>end <ide><path>railties/lib/rails/commands/test.rb <del>require "rails/test_unit/minitest_plugin" <del> <del>if defined?(ENGINE_ROOT) <del> $LOAD_PATH << File.expand_path("test", ENGINE_ROOT) <del>else <del> $LOAD_PATH << File.expand_path("../../test", APP_PATH) <del>end <del> <del>Minitest.run_via[:rails] = true <del> <del>require "active_support/testing/autorun" <ide><path>railties/lib/rails/engine/commands_tasks.rb <del>require "rails/commands/rake_proxy" <del>require "rails/commands/common_commands_tasks" <del>require "active_support/core_ext/string/strip" <del> <del>module Rails <del> class Engine <del> class CommandsTasks # :nodoc: <del> include Rails::RakeProxy <del> include Rails::CommonCommandsTasks <del> <del> attr_reader :argv <del> <del> def initialize(argv) <del> @argv = argv <del> end <del> <del> private <del> <del> def commands <del> formatted_rake_tasks <del> end <del> <del> def command_whitelist <del> %w(generate destroy version help test) <del> end <del> <del> def help_message <del> <<-EOT.strip_heredoc <del> Usage: bin/rails COMMAND [ARGS] <del> <del> The common Rails commands available for engines are: <del> generate Generate new code (short-cut alias: "g") <del> destroy Undo code generated with "generate" (short-cut alias: "d") <del> test Run tests (short-cut alias: "t") <del> <del> All commands can be run with -h for more information. <del> <del> If you want to run any commands that need to be run in context <del> of the application, like `rails server` or `rails console`, <del> you should do it from application's directory (typically test/dummy). <del> <del> In addition to those commands, there are: <del> EOT <del> end <del> <del> def require_application_and_environment! <del> require ENGINE_PATH <del> end <del> <del> def load_tasks <del> Rake.application.init("rails") <del> Rake.application.load_rakefile <del> end <del> <del> def load_generators <del> engine = ::Rails::Engine.find(ENGINE_ROOT) <del> Rails::Generators.namespace = engine.railtie_namespace <del> engine.load_generators <del> end <del> end <del> end <del>end
14
PHP
PHP
add ses_region to local environment file
d75a0f3bafe9e4b56f24ea52d43c0d68d877c1dd
<ide><path>config/services.php <ide> 'ses' => [ <ide> 'key' => env('SES_KEY'), <ide> 'secret' => env('SES_SECRET'), <del> 'region' => 'us-east-1', <add> 'region' => env('SES_REGION','us-east-1'), <ide> ], <ide> <ide> 'sparkpost' => [
1
Javascript
Javascript
fix backgroundcolor typing.
a43fd60e18aff9ee6bcaf8ec576adb8678d5bcf4
<ide><path>Libraries/Components/TextInput/InputAccessoryView.js <ide> <ide> 'use strict'; <ide> <del>const DeprecatedColorPropType = require('../../DeprecatedPropTypes/DeprecatedColorPropType'); <ide> const Platform = require('../../Utilities/Platform'); <ide> const React = require('react'); <ide> const StyleSheet = require('../../StyleSheet/StyleSheet'); <ide> <ide> import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent'; <ide> <ide> import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; <add>import type {ColorValue} from '../../StyleSheet/StyleSheetTypes'; <ide> <ide> /** <ide> * Note: iOS only <ide> type Props = $ReadOnly<{| <ide> */ <ide> nativeID?: ?string, <ide> style?: ?ViewStyleProp, <del> backgroundColor?: ?DeprecatedColorPropType, <add> backgroundColor?: ?ColorValue, <ide> |}>; <ide> <ide> class InputAccessoryView extends React.Component<Props> {
1
PHP
PHP
remove unused function
f747225b893bb1f3564619b60d665b1dfa88fe12
<ide><path>src/TestSuite/IntegrationTestCase.php <ide> protected function _url($url) <ide> return [$path, $query]; <ide> } <ide> <del> /** <del> * Convert an array URL into a string so we can dispatch it. <del> * <del> * This requires loading routes. <del> * <del> * @param array $url The routing URL to resolve. <del> * @return string The resolved route. <del> */ <del> protected function resolveRoute(array $url) <del> { <del> } <del> <ide> /** <ide> * Get the response body as string <ide> *
1
Text
Text
make minor improvements to stream.md
1fceccb4cfe250dffe9455fd2158db452376c8cc
<ide><path>doc/api/stream.md <ide> added: v8.0.0 <ide> * Returns: {this} <ide> <ide> Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` <del>event unless `emitClose` is set in `false`. After this call, the writable <add>event (unless `emitClose` is set to `false`). After this call, the writable <ide> stream has ended and subsequent calls to `write()` or `end()` will result in <ide> an `ERR_STREAM_DESTROYED` error. <ide> This is a destructive and immediate way to destroy a stream. Previous calls to <ide> added: v8.0.0 <ide> * Returns: {this} <ide> <ide> Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` <del>event unless `emitClose` is set in `false`. After this call, the readable <add>event (unless `emitClose` is set to `false`). After this call, the readable <ide> stream will release any internal resources and subsequent calls to `push()` <ide> will be ignored. <ide> Implementors should not override this method, but instead implement
1
Go
Go
remove deprecated filter functions
c334a87aec0de7467d5b1661666e779eb6416075
<ide><path>api/types/filters/parse.go <ide> package filters // import "github.com/docker/docker/api/types/filters" <ide> <ide> import ( <ide> "encoding/json" <del> "errors" <ide> "regexp" <ide> "strings" <ide> <ide> func NewArgs(initialArgs ...KeyValuePair) Args { <ide> return args <ide> } <ide> <del>// ParseFlag parses a key=value string and adds it to an Args. <del>// <del>// Deprecated: Use Args.Add() <del>func ParseFlag(arg string, prev Args) (Args, error) { <del> filters := prev <del> if len(arg) == 0 { <del> return filters, nil <del> } <del> <del> if !strings.Contains(arg, "=") { <del> return filters, ErrBadFormat <del> } <del> <del> f := strings.SplitN(arg, "=", 2) <del> <del> name := strings.ToLower(strings.TrimSpace(f[0])) <del> value := strings.TrimSpace(f[1]) <del> <del> filters.Add(name, value) <del> <del> return filters, nil <del>} <del> <del>// ErrBadFormat is an error returned when a filter is not in the form key=value <del>// <del>// Deprecated: this error will be removed in a future version <del>var ErrBadFormat = errors.New("bad format of filter (expected name=value)") <del> <del>// ToParam encodes the Args as args JSON encoded string <del>// <del>// Deprecated: use ToJSON <del>func ToParam(a Args) (string, error) { <del> return ToJSON(a) <del>} <del> <ide> // MarshalJSON returns a JSON byte representation of the Args <ide> func (args Args) MarshalJSON() ([]byte, error) { <ide> if len(args.fields) == 0 { <ide> func ToParamWithVersion(version string, a Args) (string, error) { <ide> return ToJSON(a) <ide> } <ide> <del>// FromParam decodes a JSON encoded string into Args <del>// <del>// Deprecated: use FromJSON <del>func FromParam(p string) (Args, error) { <del> return FromJSON(p) <del>} <del> <ide> // FromJSON decodes a JSON encoded string into Args <ide> func FromJSON(p string) (Args, error) { <ide> args := NewArgs() <ide> func (args Args) FuzzyMatch(key, source string) bool { <ide> return false <ide> } <ide> <del>// Include returns true if the key exists in the mapping <del>// <del>// Deprecated: use Contains <del>func (args Args) Include(field string) bool { <del> _, ok := args.fields[field] <del> return ok <del>} <del> <ide> // Contains returns true if the key exists in the mapping <ide> func (args Args) Contains(field string) bool { <ide> _, ok := args.fields[field] <ide><path>api/types/filters/parse_test.go <ide> import ( <ide> is "gotest.tools/assert/cmp" <ide> ) <ide> <del>func TestParseArgs(t *testing.T) { <del> // equivalent of `docker ps -f 'created=today' -f 'image.name=ubuntu*' -f 'image.name=*untu'` <del> flagArgs := []string{ <del> "created=today", <del> "image.name=ubuntu*", <del> "image.name=*untu", <del> } <del> var ( <del> args = NewArgs() <del> err error <del> ) <del> <del> for i := range flagArgs { <del> args, err = ParseFlag(flagArgs[i], args) <del> assert.NilError(t, err) <del> } <del> assert.Check(t, is.Len(args.Get("created"), 1)) <del> assert.Check(t, is.Len(args.Get("image.name"), 2)) <del>} <del> <del>func TestParseArgsEdgeCase(t *testing.T) { <del> var args Args <del> args, err := ParseFlag("", args) <del> if err != nil { <del> t.Fatal(err) <del> } <del> if args.Len() != 0 { <del> t.Fatalf("Expected an empty Args (map), got %v", args) <del> } <del> if args, err = ParseFlag("anything", args); err == nil || err != ErrBadFormat { <del> t.Fatalf("Expected ErrBadFormat, got %v", err) <del> } <del>} <del> <ide> func TestToJSON(t *testing.T) { <ide> fields := map[string]map[string]bool{ <ide> "created": {"today": true}, <ide> func TestContains(t *testing.T) { <ide> } <ide> } <ide> <del>func TestInclude(t *testing.T) { <del> f := NewArgs() <del> if f.Include("status") { <del> t.Fatal("Expected to not include a status key, got true") <del> } <del> f.Add("status", "running") <del> if !f.Include("status") { <del> t.Fatal("Expected to include a status key, got false") <del> } <del>} <del> <ide> func TestValidate(t *testing.T) { <ide> f := NewArgs() <ide> f.Add("status", "running") <ide><path>builder/builder-next/builder.go <ide> func toBuildkitPruneInfo(opts types.BuildCachePruneOptions) (client.PruneInfo, e <ide> <ide> bkFilter := make([]string, 0, opts.Filters.Len()) <ide> for cacheField := range cacheFields { <del> if opts.Filters.Include(cacheField) { <add> if opts.Filters.Contains(cacheField) { <ide> values := opts.Filters.Get(cacheField) <ide> switch len(values) { <ide> case 0:
3
Go
Go
add tag store
7de380c5c673411639d84e07c29830eb81cb1c8d
<ide><path>tag/store.go <add>package tag <add> <add>import ( <add> "encoding/json" <add> "errors" <add> "fmt" <add> "io/ioutil" <add> "os" <add> "path/filepath" <add> "sync" <add> <add> "github.com/docker/distribution/reference" <add> "github.com/docker/docker/image" <add>) <add> <add>// DefaultTag defines the default tag used when performing images related actions and no tag string is specified <add>const DefaultTag = "latest" <add> <add>var ( <add> // ErrDoesNotExist is returned if a reference is not found in the <add> // store. <add> ErrDoesNotExist = errors.New("reference does not exist") <add>) <add> <add>// An Association is a tuple associating a reference with an image ID. <add>type Association struct { <add> Ref reference.Named <add> ImageID image.ID <add>} <add> <add>// Store provides the set of methods which can operate on a tag store. <add>type Store interface { <add> References(id image.ID) []reference.Named <add> ReferencesByName(ref reference.Named) []Association <add> Add(ref reference.Named, id image.ID, force bool) error <add> Delete(ref reference.Named) (bool, error) <add> Get(ref reference.Named) (image.ID, error) <add>} <add> <add>type store struct { <add> mu sync.RWMutex <add> // jsonPath is the path to the file where the serialized tag data is <add> // stored. <add> jsonPath string <add> // Repositories is a map of repositories, indexed by name. <add> Repositories map[string]repository <add> // referencesByIDCache is a cache of references indexed by ID, to speed <add> // up References. <add> referencesByIDCache map[image.ID]map[string]reference.Named <add>} <add> <add>// Repository maps tags to image IDs. The key is a a stringified Reference, <add>// including the repository name. <add>type repository map[string]image.ID <add> <add>func defaultTagIfNameOnly(ref reference.Named) reference.Named { <add> switch ref.(type) { <add> case reference.Tagged: <add> return ref <add> case reference.Digested: <add> return ref <add> default: <add> // Should never fail <add> ref, _ = reference.WithTag(ref, DefaultTag) <add> return ref <add> } <add>} <add> <add>// NewTagStore creates a new tag store, tied to a file path where the set of <add>// tags is serialized in JSON format. <add>func NewTagStore(jsonPath string) (Store, error) { <add> abspath, err := filepath.Abs(jsonPath) <add> if err != nil { <add> return nil, err <add> } <add> <add> store := &store{ <add> jsonPath: abspath, <add> Repositories: make(map[string]repository), <add> referencesByIDCache: make(map[image.ID]map[string]reference.Named), <add> } <add> // Load the json file if it exists, otherwise create it. <add> if err := store.reload(); os.IsNotExist(err) { <add> if err := store.save(); err != nil { <add> return nil, err <add> } <add> } else if err != nil { <add> return nil, err <add> } <add> return store, nil <add>} <add> <add>// Add adds a tag or digest to the store. If force is set to true, existing <add>// references can be overwritten. This only works for tags, not digests. <add>func (store *store) Add(ref reference.Named, id image.ID, force bool) error { <add> ref = defaultTagIfNameOnly(ref) <add> <add> store.mu.Lock() <add> defer store.mu.Unlock() <add> <add> repository, exists := store.Repositories[ref.Name()] <add> if !exists || repository == nil { <add> repository = make(map[string]image.ID) <add> store.Repositories[ref.Name()] = repository <add> } <add> <add> refStr := ref.String() <add> oldID, exists := repository[refStr] <add> <add> if exists { <add> // force only works for tags <add> if digested, isDigest := ref.(reference.Digested); isDigest { <add> return fmt.Errorf("Cannot overwrite digest %s", digested.Digest().String()) <add> } <add> <add> if !force { <add> return fmt.Errorf("Conflict: Tag %s is already set to image %s, if you want to replace it, please use -f option", ref.String(), oldID.String()) <add> } <add> <add> if store.referencesByIDCache[oldID] != nil { <add> delete(store.referencesByIDCache[oldID], refStr) <add> if len(store.referencesByIDCache[oldID]) == 0 { <add> delete(store.referencesByIDCache, oldID) <add> } <add> } <add> } <add> <add> repository[refStr] = id <add> if store.referencesByIDCache[id] == nil { <add> store.referencesByIDCache[id] = make(map[string]reference.Named) <add> } <add> store.referencesByIDCache[id][refStr] = ref <add> <add> return store.save() <add>} <add> <add>// Delete deletes a reference from the store. It returns true if a deletion <add>// happened, or false otherwise. <add>func (store *store) Delete(ref reference.Named) (bool, error) { <add> ref = defaultTagIfNameOnly(ref) <add> <add> store.mu.Lock() <add> defer store.mu.Unlock() <add> <add> repoName := ref.Name() <add> <add> repository, exists := store.Repositories[repoName] <add> if !exists { <add> return false, ErrDoesNotExist <add> } <add> <add> refStr := ref.String() <add> if id, exists := repository[refStr]; exists { <add> delete(repository, refStr) <add> if len(repository) == 0 { <add> delete(store.Repositories, repoName) <add> } <add> if store.referencesByIDCache[id] != nil { <add> delete(store.referencesByIDCache[id], refStr) <add> if len(store.referencesByIDCache[id]) == 0 { <add> delete(store.referencesByIDCache, id) <add> } <add> } <add> return true, store.save() <add> } <add> <add> return false, ErrDoesNotExist <add>} <add> <add>// Get retrieves an item from the store by reference. <add>func (store *store) Get(ref reference.Named) (image.ID, error) { <add> ref = defaultTagIfNameOnly(ref) <add> <add> store.mu.RLock() <add> defer store.mu.RUnlock() <add> <add> repository, exists := store.Repositories[ref.Name()] <add> if !exists || repository == nil { <add> return "", ErrDoesNotExist <add> } <add> <add> id, exists := repository[ref.String()] <add> if !exists { <add> return "", ErrDoesNotExist <add> } <add> <add> return id, nil <add>} <add> <add>// References returns a slice of references to the given image ID. The slice <add>// will be nil if there are no references to this image ID. <add>func (store *store) References(id image.ID) []reference.Named { <add> store.mu.RLock() <add> defer store.mu.RUnlock() <add> <add> // Convert the internal map to an array for two reasons: <add> // 1) We must not return a mutable reference. <add> // 2) It would be ugly to expose the extraneous map keys to callers. <add> <add> var references []reference.Named <add> for _, ref := range store.referencesByIDCache[id] { <add> references = append(references, ref) <add> } <add> <add> return references <add>} <add> <add>// ReferencesByName returns the references for a given repository name. <add>// If there are no references known for this repository name, <add>// ReferencesByName returns nil. <add>func (store *store) ReferencesByName(ref reference.Named) []Association { <add> store.mu.RLock() <add> defer store.mu.RUnlock() <add> <add> repository, exists := store.Repositories[ref.Name()] <add> if !exists { <add> return nil <add> } <add> <add> var associations []Association <add> for refStr, refID := range repository { <add> ref, err := reference.ParseNamed(refStr) <add> if err != nil { <add> // Should never happen <add> return nil <add> } <add> associations = append(associations, <add> Association{ <add> Ref: ref, <add> ImageID: refID, <add> }) <add> } <add> <add> return associations <add>} <add> <add>func (store *store) save() error { <add> // Store the json <add> jsonData, err := json.Marshal(store) <add> if err != nil { <add> return err <add> } <add> <add> tempFilePath := store.jsonPath + ".tmp" <add> <add> if err := ioutil.WriteFile(tempFilePath, jsonData, 0600); err != nil { <add> return err <add> } <add> <add> if err := os.Rename(tempFilePath, store.jsonPath); err != nil { <add> return err <add> } <add> <add> return nil <add>} <add> <add>func (store *store) reload() error { <add> f, err := os.Open(store.jsonPath) <add> if err != nil { <add> return err <add> } <add> defer f.Close() <add> if err := json.NewDecoder(f).Decode(&store); err != nil { <add> return err <add> } <add> <add> for _, repository := range store.Repositories { <add> for refStr, refID := range repository { <add> ref, err := reference.ParseNamed(refStr) <add> if err != nil { <add> // Should never happen <add> continue <add> } <add> if store.referencesByIDCache[refID] == nil { <add> store.referencesByIDCache[refID] = make(map[string]reference.Named) <add> } <add> store.referencesByIDCache[refID][refStr] = ref <add> } <add> } <add> <add> return nil <add>} <ide><path>tag/store_test.go <add>package tag <add> <add>import ( <add> "bytes" <add> "io/ioutil" <add> "os" <add> "sort" <add> "strings" <add> "testing" <add> <add> "github.com/docker/distribution/reference" <add> "github.com/docker/docker/image" <add>) <add> <add>var ( <add> saveLoadTestCases = map[string]image.ID{ <add> "registry:5000/foobar:HEAD": "sha256:470022b8af682154f57a2163d030eb369549549cba00edc69e1b99b46bb924d6", <add> "registry:5000/foobar:alternate": "sha256:ae300ebc4a4f00693702cfb0a5e0b7bc527b353828dc86ad09fb95c8a681b793", <add> "registry:5000/foobar:latest": "sha256:6153498b9ac00968d71b66cca4eac37e990b5f9eb50c26877eb8799c8847451b", <add> "registry:5000/foobar:master": "sha256:6c9917af4c4e05001b346421959d7ea81b6dc9d25718466a37a6add865dfd7fc", <add> "jess/hollywood:latest": "sha256:ae7a5519a0a55a2d4ef20ddcbd5d0ca0888a1f7ab806acc8e2a27baf46f529fe", <add> "registry@sha256:367eb40fd0330a7e464777121e39d2f5b3e8e23a1e159342e53ab05c9e4d94e6": "sha256:24126a56805beb9711be5f4590cc2eb55ab8d4a85ebd618eed72bb19fc50631c", <add> "busybox:latest": "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", <add> } <add> <add> marshalledSaveLoadTestCases = []byte(`{"Repositories":{"busybox":{"busybox:latest":"sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c"},"jess/hollywood":{"jess/hollywood:latest":"sha256:ae7a5519a0a55a2d4ef20ddcbd5d0ca0888a1f7ab806acc8e2a27baf46f529fe"},"registry":{"registry@sha256:367eb40fd0330a7e464777121e39d2f5b3e8e23a1e159342e53ab05c9e4d94e6":"sha256:24126a56805beb9711be5f4590cc2eb55ab8d4a85ebd618eed72bb19fc50631c"},"registry:5000/foobar":{"registry:5000/foobar:HEAD":"sha256:470022b8af682154f57a2163d030eb369549549cba00edc69e1b99b46bb924d6","registry:5000/foobar:alternate":"sha256:ae300ebc4a4f00693702cfb0a5e0b7bc527b353828dc86ad09fb95c8a681b793","registry:5000/foobar:latest":"sha256:6153498b9ac00968d71b66cca4eac37e990b5f9eb50c26877eb8799c8847451b","registry:5000/foobar:master":"sha256:6c9917af4c4e05001b346421959d7ea81b6dc9d25718466a37a6add865dfd7fc"}}}`) <add>) <add> <add>func TestLoad(t *testing.T) { <add> jsonFile, err := ioutil.TempFile("", "tag-store-test") <add> if err != nil { <add> t.Fatalf("error creating temp file: %v", err) <add> } <add> defer os.RemoveAll(jsonFile.Name()) <add> <add> // Write canned json to the temp file <add> _, err = jsonFile.Write(marshalledSaveLoadTestCases) <add> if err != nil { <add> t.Fatalf("error writing to temp file: %v", err) <add> } <add> jsonFile.Close() <add> <add> store, err := NewTagStore(jsonFile.Name()) <add> if err != nil { <add> t.Fatalf("error creating tag store: %v", err) <add> } <add> <add> for refStr, expectedID := range saveLoadTestCases { <add> ref, err := reference.ParseNamed(refStr) <add> if err != nil { <add> t.Fatalf("failed to parse reference: %v", err) <add> } <add> id, err := store.Get(ref) <add> if err != nil { <add> t.Fatalf("could not find reference %s: %v", refStr, err) <add> } <add> if id != expectedID { <add> t.Fatalf("expected %s - got %s", expectedID, id) <add> } <add> } <add>} <add> <add>func TestSave(t *testing.T) { <add> jsonFile, err := ioutil.TempFile("", "tag-store-test") <add> if err != nil { <add> t.Fatalf("error creating temp file: %v", err) <add> } <add> _, err = jsonFile.Write([]byte(`{}`)) <add> jsonFile.Close() <add> defer os.RemoveAll(jsonFile.Name()) <add> <add> store, err := NewTagStore(jsonFile.Name()) <add> if err != nil { <add> t.Fatalf("error creating tag store: %v", err) <add> } <add> <add> for refStr, id := range saveLoadTestCases { <add> ref, err := reference.ParseNamed(refStr) <add> if err != nil { <add> t.Fatalf("failed to parse reference: %v", err) <add> } <add> err = store.Add(ref, id, false) <add> if err != nil { <add> t.Fatalf("could not add reference %s: %v", refStr, err) <add> } <add> } <add> <add> jsonBytes, err := ioutil.ReadFile(jsonFile.Name()) <add> if err != nil { <add> t.Fatalf("could not read json file: %v", err) <add> } <add> <add> if !bytes.Equal(jsonBytes, marshalledSaveLoadTestCases) { <add> t.Fatalf("save output did not match expectations\nexpected:\n%s\ngot:\n%s", marshalledSaveLoadTestCases, jsonBytes) <add> } <add>} <add> <add>type LexicalRefs []reference.Named <add> <add>func (a LexicalRefs) Len() int { return len(a) } <add>func (a LexicalRefs) Swap(i, j int) { a[i], a[j] = a[j], a[i] } <add>func (a LexicalRefs) Less(i, j int) bool { return a[i].String() < a[j].String() } <add> <add>type LexicalAssociations []Association <add> <add>func (a LexicalAssociations) Len() int { return len(a) } <add>func (a LexicalAssociations) Swap(i, j int) { a[i], a[j] = a[j], a[i] } <add>func (a LexicalAssociations) Less(i, j int) bool { return a[i].Ref.String() < a[j].Ref.String() } <add> <add>func TestAddDeleteGet(t *testing.T) { <add> jsonFile, err := ioutil.TempFile("", "tag-store-test") <add> if err != nil { <add> t.Fatalf("error creating temp file: %v", err) <add> } <add> _, err = jsonFile.Write([]byte(`{}`)) <add> jsonFile.Close() <add> defer os.RemoveAll(jsonFile.Name()) <add> <add> store, err := NewTagStore(jsonFile.Name()) <add> if err != nil { <add> t.Fatalf("error creating tag store: %v", err) <add> } <add> <add> testImageID1 := image.ID("sha256:9655aef5fd742a1b4e1b7b163aa9f1c76c186304bf39102283d80927c916ca9c") <add> testImageID2 := image.ID("sha256:9655aef5fd742a1b4e1b7b163aa9f1c76c186304bf39102283d80927c916ca9d") <add> testImageID3 := image.ID("sha256:9655aef5fd742a1b4e1b7b163aa9f1c76c186304bf39102283d80927c916ca9e") <add> <add> // Try adding a reference with no tag or digest <add> nameOnly, err := reference.WithName("username/repo") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if err = store.Add(nameOnly, testImageID1, false); err != nil { <add> t.Fatalf("error adding to store: %v", err) <add> } <add> <add> // Add a few references <add> ref1, err := reference.ParseNamed("username/repo1:latest") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if err = store.Add(ref1, testImageID1, false); err != nil { <add> t.Fatalf("error adding to store: %v", err) <add> } <add> <add> ref2, err := reference.ParseNamed("username/repo1:old") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if err = store.Add(ref2, testImageID2, false); err != nil { <add> t.Fatalf("error adding to store: %v", err) <add> } <add> <add> ref3, err := reference.ParseNamed("username/repo1:alias") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if err = store.Add(ref3, testImageID1, false); err != nil { <add> t.Fatalf("error adding to store: %v", err) <add> } <add> <add> ref4, err := reference.ParseNamed("username/repo2:latest") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if err = store.Add(ref4, testImageID2, false); err != nil { <add> t.Fatalf("error adding to store: %v", err) <add> } <add> <add> ref5, err := reference.ParseNamed("username/repo3@sha256:58153dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if err = store.Add(ref5, testImageID2, false); err != nil { <add> t.Fatalf("error adding to store: %v", err) <add> } <add> <add> // Attempt to overwrite with force == false <add> if err = store.Add(ref4, testImageID3, false); err == nil || !strings.HasPrefix(err.Error(), "Conflict:") { <add> t.Fatalf("did not get expected error on overwrite attempt - got %v", err) <add> } <add> // Repeat to overwrite with force == true <add> if err = store.Add(ref4, testImageID3, true); err != nil { <add> t.Fatalf("failed to force tag overwrite: %v", err) <add> } <add> <add> // Check references so far <add> id, err := store.Get(nameOnly) <add> if err != nil { <add> t.Fatalf("Get returned error: %v", err) <add> } <add> if id != testImageID1 { <add> t.Fatalf("id mismatch: got %s instead of %s", id.String(), testImageID1.String()) <add> } <add> <add> id, err = store.Get(ref1) <add> if err != nil { <add> t.Fatalf("Get returned error: %v", err) <add> } <add> if id != testImageID1 { <add> t.Fatalf("id mismatch: got %s instead of %s", id.String(), testImageID1.String()) <add> } <add> <add> id, err = store.Get(ref2) <add> if err != nil { <add> t.Fatalf("Get returned error: %v", err) <add> } <add> if id != testImageID2 { <add> t.Fatalf("id mismatch: got %s instead of %s", id.String(), testImageID2.String()) <add> } <add> <add> id, err = store.Get(ref3) <add> if err != nil { <add> t.Fatalf("Get returned error: %v", err) <add> } <add> if id != testImageID1 { <add> t.Fatalf("id mismatch: got %s instead of %s", id.String(), testImageID1.String()) <add> } <add> <add> id, err = store.Get(ref4) <add> if err != nil { <add> t.Fatalf("Get returned error: %v", err) <add> } <add> if id != testImageID3 { <add> t.Fatalf("id mismatch: got %s instead of %s", id.String(), testImageID3.String()) <add> } <add> <add> id, err = store.Get(ref5) <add> if err != nil { <add> t.Fatalf("Get returned error: %v", err) <add> } <add> if id != testImageID2 { <add> t.Fatalf("id mismatch: got %s instead of %s", id.String(), testImageID3.String()) <add> } <add> <add> // Get should return ErrDoesNotExist for a nonexistent repo <add> nonExistRepo, err := reference.ParseNamed("username/nonexistrepo:latest") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if _, err = store.Get(nonExistRepo); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Get") <add> } <add> <add> // Get should return ErrDoesNotExist for a nonexistent tag <add> nonExistTag, err := reference.ParseNamed("username/repo1:nonexist") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> if _, err = store.Get(nonExistTag); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Get") <add> } <add> <add> // Check References <add> refs := store.References(testImageID1) <add> sort.Sort(LexicalRefs(refs)) <add> if len(refs) != 3 { <add> t.Fatal("unexpected number of references") <add> } <add> if refs[0].String() != ref3.String() { <add> t.Fatalf("unexpected reference: %v", refs[0].String()) <add> } <add> if refs[1].String() != ref1.String() { <add> t.Fatalf("unexpected reference: %v", refs[1].String()) <add> } <add> if refs[2].String() != nameOnly.String()+":latest" { <add> t.Fatalf("unexpected reference: %v", refs[2].String()) <add> } <add> <add> // Check ReferencesByName <add> repoName, err := reference.WithName("username/repo1") <add> if err != nil { <add> t.Fatalf("could not parse reference: %v", err) <add> } <add> associations := store.ReferencesByName(repoName) <add> sort.Sort(LexicalAssociations(associations)) <add> if len(associations) != 3 { <add> t.Fatal("unexpected number of associations") <add> } <add> if associations[0].Ref.String() != ref3.String() { <add> t.Fatalf("unexpected reference: %v", associations[0].Ref.String()) <add> } <add> if associations[0].ImageID != testImageID1 { <add> t.Fatalf("unexpected reference: %v", associations[0].Ref.String()) <add> } <add> if associations[1].Ref.String() != ref1.String() { <add> t.Fatalf("unexpected reference: %v", associations[1].Ref.String()) <add> } <add> if associations[1].ImageID != testImageID1 { <add> t.Fatalf("unexpected reference: %v", associations[1].Ref.String()) <add> } <add> if associations[2].Ref.String() != ref2.String() { <add> t.Fatalf("unexpected reference: %v", associations[2].Ref.String()) <add> } <add> if associations[2].ImageID != testImageID2 { <add> t.Fatalf("unexpected reference: %v", associations[2].Ref.String()) <add> } <add> <add> // Delete should return ErrDoesNotExist for a nonexistent repo <add> if _, err = store.Delete(nonExistRepo); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Delete") <add> } <add> <add> // Delete should return ErrDoesNotExist for a nonexistent tag <add> if _, err = store.Delete(nonExistTag); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Delete") <add> } <add> <add> // Delete a few references <add> if deleted, err := store.Delete(ref1); err != nil || deleted != true { <add> t.Fatal("Delete failed") <add> } <add> if _, err := store.Get(ref1); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Get") <add> } <add> if deleted, err := store.Delete(ref5); err != nil || deleted != true { <add> t.Fatal("Delete failed") <add> } <add> if _, err := store.Get(ref5); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Get") <add> } <add> if deleted, err := store.Delete(nameOnly); err != nil || deleted != true { <add> t.Fatal("Delete failed") <add> } <add> if _, err := store.Get(nameOnly); err != ErrDoesNotExist { <add> t.Fatal("Expected ErrDoesNotExist from Get") <add> } <add>}
2
Javascript
Javascript
improve test case
a7f9d4d40b679c15bd22efa8ff97da93f5df4136
<ide><path>test/cases/side-effects/dynamic-reexports/checked-export/index.js <ide> export { value, value2 } from "./module"; <add> <add>throw new Error("Should not be loaded"); <ide><path>test/cases/side-effects/dynamic-reexports/dedupe-target-static/index.js <ide> export * from "./a"; <ide> export * from "./b"; <add> <add>throw new Error("Should not be loaded"); <ide><path>test/cases/side-effects/dynamic-reexports/dedupe-target/index.js <ide> export * from "./a"; <ide> export * from "./b"; <add> <add>throw new Error("Should not be loaded"); <ide><path>test/cases/side-effects/dynamic-reexports/multiple-sources/index.js <ide> export * from "./module"; <del>export * from "./b"; <add> <add>throw new Error("Should not be loaded"); <ide><path>test/cases/side-effects/dynamic-reexports/multiple-sources/module.js <add>export * from "./module2"; <ide> export * from "./a"; <ide><path>test/cases/side-effects/dynamic-reexports/multiple-sources/module2.js <add>export * from "./b";
6
PHP
PHP
improve crypt class comments
825ac35a47d410f53a8bf1ca09bac55651e11197
<ide><path>system/crypt.php <ide> class Crypt { <ide> public static function encrypt($value) <ide> { <ide> // ----------------------------------------------------- <del> // Determine the input vector source. <add> // Determine the input vector source. Different servers <add> // and operating systems will have varying options. <ide> // ----------------------------------------------------- <ide> if (defined('MCRYPT_DEV_URANDOM')) <ide> { <ide> public static function encrypt($value) <ide> } <ide> <ide> // ----------------------------------------------------- <del> // The system random number generator must be seeded. <add> // The system random number generator must be seeded <add> // to produce adequately random results. <ide> // ----------------------------------------------------- <ide> if ($random === MCRYPT_RAND) <ide> { <ide> mt_srand(); <ide> } <ide> <del> // ----------------------------------------------------- <del> // Create the Mcrypt input vector and encrypt the value. <del> // ----------------------------------------------------- <ide> $iv = mcrypt_create_iv(static::iv_size(), $random); <ide> $value = mcrypt_encrypt(static::$cipher, static::key(), $value, static::$mode, $iv); <ide> <ide> // ----------------------------------------------------- <del> // Use base64 encoding to get a string value. <add> // We use base64 encoding to get a nice string value. <ide> // ----------------------------------------------------- <ide> return base64_encode($iv.$value); <ide> } <ide> public static function encrypt($value) <ide> */ <ide> public static function decrypt($value) <ide> { <add> // ----------------------------------------------------- <add> // Since all of our encrypted values are base64 encoded, <add> // we will decode the value here and verify it. <add> // ----------------------------------------------------- <ide> $value = base64_decode($value, true); <ide> <ide> if ( ! $value) <ide> public static function decrypt($value) <ide> $iv = substr($value, 0, static::iv_size()); <ide> <ide> // ----------------------------------------------------- <del> // Remove the input vector from the value. <add> // Remove the input vector from the encrypted value. <ide> // ----------------------------------------------------- <ide> $value = substr($value, static::iv_size()); <ide> <ide> private static function key() <ide> /** <ide> * Get the input vector size for the cipher and mode. <ide> * <add> * Different ciphers and modes use varying lengths of input vectors. <add> * <ide> * @return int <ide> */ <ide> private static function iv_size()
1
PHP
PHP
pluralize fixtures filename
a6df593fc6871fae4fdbaa85b6b732f3b4e4aeec
<add><path>tests/Fixture/AfterTreesFixture.php <del><path>tests/Fixture/AfterTreeFixture.php <ide> * AfterTreeFixture class <ide> * <ide> */ <del>class AfterTreeFixture extends TestFixture { <add>class AfterTreesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/ArticlesFixture.php <del><path>tests/Fixture/ArticleFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class ArticleFixture extends TestFixture { <add>class ArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/ArticlesTagsFixture.php <del><path>tests/Fixture/ArticlesTagFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class ArticlesTagFixture extends TestFixture { <add>class ArticlesTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/AttachmentsFixture.php <del><path>tests/Fixture/AttachmentFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class AttachmentFixture extends TestFixture { <add>class AttachmentsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/AuthUserCustomFieldsFixture.php <del><path>tests/Fixture/AuthUserCustomFieldFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class AuthUserCustomFieldFixture extends TestFixture { <add>class AuthUserCustomFieldsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/AuthUsersFixture.php <del><path>tests/Fixture/AuthUserFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class AuthUserFixture extends TestFixture { <add>class AuthUsersFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/AuthorsFixture.php <del><path>tests/Fixture/AuthorFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class AuthorFixture extends TestFixture { <add>class AuthorsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/BakeArticlesBakeTagsFixture.php <del><path>tests/Fixture/BakeArticlesBakeTagFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class BakeArticlesBakeTagFixture extends TestFixture { <add>class BakeArticlesBakeTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/BakeArticlesFixture.php <del><path>tests/Fixture/BakeArticleFixture.php <ide> * BakeArticleFixture <ide> * <ide> */ <del>class BakeArticleFixture extends TestFixture { <add>class BakeArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/BakeCommentsFixture.php <del><path>tests/Fixture/BakeCommentFixture.php <ide> * BakeCommentFixture fixture for testing bake <ide> * <ide> */ <del>class BakeCommentFixture extends TestFixture { <add>class BakeCommentsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/BakeTagsFixture.php <del><path>tests/Fixture/BakeTagFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class BakeTagFixture extends TestFixture { <add>class BakeTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/BinaryTestsFixture.php <del><path>tests/Fixture/BinaryTestFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class BinaryTestFixture extends TestFixture { <add>class BinaryTestsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/CakeSessionsFixture.php <del><path>tests/Fixture/CakeSessionFixture.php <ide> * Class SessionFixture <ide> * <ide> */ <del>class CakeSessionFixture extends TestFixture { <add>class CakeSessionsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/CategoriesFixture.php <del><path>tests/Fixture/CategoryFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class CategoryFixture extends TestFixture { <add>class CategoriesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/CategoryThreadsFixture.php <del><path>tests/Fixture/CategoryThreadFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class CategoryThreadFixture extends TestFixture { <add>class CategoryThreadsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/CommentsFixture.php <del><path>tests/Fixture/CommentFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class CommentFixture extends TestFixture { <add>class CommentsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/CounterCachePostsFixture.php <del><path>tests/Fixture/CounterCachePostFixture.php <ide> * Counter Cache Test Fixtures <ide> * <ide> */ <del>class CounterCachePostFixture extends TestFixture { <add>class CounterCachePostsFixture extends TestFixture { <ide> <ide> public $fields = array( <ide> 'id' => ['type' => 'integer'], <add><path>tests/Fixture/CounterCacheUsersFixture.php <del><path>tests/Fixture/CounterCacheUserFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class CounterCacheUserFixture extends TestFixture { <add>class CounterCacheUsersFixture extends TestFixture { <ide> <ide> public $fields = array( <ide> 'id' => ['type' => 'integer'], <add><path>tests/Fixture/DataTestsFixture.php <del><path>tests/Fixture/DataTestFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class DataTestFixture extends TestFixture { <add>class DataTestsFixture extends TestFixture { <ide> <ide> /** <ide> * Fields property <add><path>tests/Fixture/DatatypesFixture.php <del><path>tests/Fixture/DatatypeFixture.php <ide> * Short description for class. <ide> * <ide> */ <del>class DatatypeFixture extends TestFixture { <add>class DatatypesFixture extends TestFixture { <ide> <ide> /** <ide> * Fields property <ide><path>tests/Fixture/FixturizedTestCase.php <ide> class FixturizedTestCase extends TestCase { <ide> * Fixtures to use in this thes <ide> * @var array <ide> */ <del> public $fixtures = array('core.category'); <add> public $fixtures = array('core.categories'); <ide> <ide> /** <ide> * test that the shared fixture is correctly set <ide> public function testFixturePresent() { <ide> * @return void <ide> */ <ide> public function testFixtureLoadOnDemand() { <del> $this->loadFixtures('Category'); <add> $this->loadFixtures('Categories'); <ide> } <ide> <ide> /** <add><path>tests/Fixture/FlagTreesFixture.php <del><path>tests/Fixture/FlagTreeFixture.php <ide> * Like Number Tree, but uses a flag for testing scope parameters <ide> * <ide> */ <del>class FlagTreeFixture extends TestFixture { <add>class FlagTreesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/MenuLinkTreesFixture.php <del><path>tests/Fixture/MenuLinkTreeFixture.php <ide> * Generates a tree of data for use testing the tree behavior <ide> * <ide> */ <del>class MenuLinkTreeFixture extends TestFixture { <add>class MenuLinkTreesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/NumberTreesFixture.php <del><path>tests/Fixture/NumberTreeFixture.php <ide> * Generates a tree of data for use testing the tree behavior <ide> * <ide> */ <del>class NumberTreeFixture extends TestFixture { <add>class NumberTreesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/PeopleFixture.php <del><path>tests/Fixture/PersonFixture.php <ide> * Class PersonFixture <ide> * <ide> */ <del>class PersonFixture extends TestFixture { <add>class PeopleFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/PostsFixture.php <del><path>tests/Fixture/PostFixture.php <ide> * Clas PostFixture <ide> * <ide> */ <del>class PostFixture extends TestFixture { <add>class PostsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/SessionsFixture.php <del><path>tests/Fixture/SessionFixture.php <ide> * Class SessionFixture <ide> * <ide> */ <del>class SessionFixture extends TestFixture { <add>class SessionsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/SiteArticlesFixture.php <del><path>tests/Fixture/SiteArticleFixture.php <ide> <ide> use Cake\TestSuite\Fixture\TestFixture; <ide> <del>class SiteArticleFixture extends TestFixture { <add>class SiteArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/SiteArticlesTagsFixture.php <del><path>tests/Fixture/SiteArticlesTagFixture.php <ide> <ide> use Cake\TestSuite\Fixture\TestFixture; <ide> <del>class SiteArticlesTagFixture extends TestFixture { <add>class SiteArticlesTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/SiteAuthorsFixture.php <del><path>tests/Fixture/SiteAuthorFixture.php <ide> <ide> use Cake\TestSuite\Fixture\TestFixture; <ide> <del>class SiteAuthorFixture extends TestFixture { <add>class SiteAuthorsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/SiteTagsFixture.php <del><path>tests/Fixture/SiteTagFixture.php <ide> <ide> use Cake\TestSuite\Fixture\TestFixture; <ide> <del>class SiteTagFixture extends TestFixture { <add>class SiteTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/SpecialTagsFixture.php <del><path>tests/Fixture/SpecialTagFixture.php <ide> * A fixture for a join table containing additional data <ide> * <ide> */ <del>class SpecialTagFixture extends TestFixture { <add>class SpecialTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/TagsFixture.php <del><path>tests/Fixture/TagFixture.php <ide> * Class TagFixture <ide> * <ide> */ <del>class TagFixture extends TestFixture { <add>class TagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/TestPluginArticlesFixture.php <del><path>tests/Fixture/TestPluginArticleFixture.php <ide> * Class TestPluginArticleFixture <ide> * <ide> */ <del>class TestPluginArticleFixture extends TestFixture { <add>class TestPluginArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/TestPluginCommentsFixture.php <del><path>tests/Fixture/TestPluginCommentFixture.php <ide> * Class TestPluginCommentFixture <ide> * <ide> */ <del>class TestPluginCommentFixture extends TestFixture { <add>class TestPluginCommentsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/ThingsFixture.php <del><path>tests/Fixture/ThingFixture.php <ide> <ide> use Cake\TestSuite\Fixture\TestFixture; <ide> <del>class ThingFixture extends TestFixture { <add>class ThingsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/TranslateArticlesFixture.php <del><path>tests/Fixture/TranslateArticleFixture.php <ide> * Class TranslateArticleFixture <ide> * <ide> */ <del>class TranslateArticleFixture extends TestFixture { <add>class TranslateArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * table property <ide><path>tests/Fixture/TranslateTableFixture.php <ide> * Class TranslateTableFixture <ide> * <ide> */ <del>class TranslateTableFixture extends TestFixture { <add>class TranslateTablesFixture extends TestFixture { <ide> <ide> /** <ide> * table property <add><path>tests/Fixture/TranslateWithPrefixesFixture.php <del><path>tests/Fixture/TranslateWithPrefixFixture.php <ide> * Class TranslateWithPrefixFixture <ide> * <ide> */ <del>class TranslateWithPrefixFixture extends TestFixture { <add>class TranslateWithPrefixesFixture extends TestFixture { <ide> <ide> /** <ide> * table property <add><path>tests/Fixture/TranslatedArticlesFixture.php <del><path>tests/Fixture/TranslatedArticleFixture.php <ide> * Class TranslatedArticleFixture <ide> * <ide> */ <del>class TranslatedArticleFixture extends TestFixture { <add>class TranslatedArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/TranslatesFixture.php <del><path>tests/Fixture/TranslateFixture.php <ide> * Class TranslateFixture <ide> * <ide> */ <del>class TranslateFixture extends TestFixture { <add>class TranslatesFixture extends TestFixture { <ide> <ide> /** <ide> * table property <ide><path>tests/Fixture/UnconventionalTreeFixture.php <ide> * <ide> * @uses TestFixture <ide> */ <del>class UnconventionalTreeFixture extends TestFixture { <add>class UnconventionalTreesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UsersFixture.php <del><path>tests/Fixture/UserFixture.php <ide> * Class UserFixture <ide> * <ide> */ <del>class UserFixture extends TestFixture { <add>class UsersFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UuidTagsFixture.php <del><path>tests/Fixture/UuidTagFixture.php <ide> * Class UuidTagFixture <ide> * <ide> */ <del>class UuidTagFixture extends TestFixture { <add>class UuidTagsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UuidTreesFixture.php <del><path>tests/Fixture/UuidTreeFixture.php <ide> * <ide> * @uses TestFixture <ide> */ <del>class UuidTreeFixture extends TestFixture { <add>class UuidTreesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UuiditemsFixture.php <del><path>tests/Fixture/UuiditemFixture.php <ide> * Class UuiditemFixture <ide> * <ide> */ <del>class UuiditemFixture extends TestFixture { <add>class UuiditemsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UuiditemsUuidportfolioNumericidsFixture.php <del><path>tests/Fixture/UuiditemsUuidportfolioNumericidFixture.php <ide> * Class UuiditemsUuidportfolioNumericidFixture <ide> * <ide> */ <del>class UuiditemsUuidportfolioNumericidFixture extends TestFixture { <add>class UuiditemsUuidportfolioNumericidsFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UuiditemsUuidportfoliosFixture.php <del><path>tests/Fixture/UuiditemsUuidportfolioFixture.php <ide> * Class UuiditemsUuidportfolioFixture <ide> * <ide> */ <del>class UuiditemsUuidportfolioFixture extends TestFixture { <add>class UuiditemsUuidportfoliosFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/Fixture/UuidportfoliosFixture.php <del><path>tests/Fixture/UuidportfolioFixture.php <ide> * Class UuidportfolioFixture <ide> * <ide> */ <del>class UuidportfolioFixture extends TestFixture { <add>class UuidportfoliosFixture extends TestFixture { <ide> <ide> /** <ide> * fields property <add><path>tests/test_app/Plugin/TestPlugin/tests/Fixture/ArticlesFixture.php <del><path>tests/test_app/Plugin/TestPlugin/tests/Fixture/ArticleFixture.php <ide> /** <ide> * Plugin article fixture. <ide> */ <del>class ArticleFixture extends TestFixture { <add>class ArticlesFixture extends TestFixture { <ide> <ide> /** <ide> * fields property
50